Sign in Go Pro

Custom Views and ViewGroups

Custom Views and ViewGroups (Part 2) – How Views Are Measured

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson

Up next



A discussion of how a View is measured in Android’s view drawing process with special attention paid to how the parent’s layout parameters, the child’s layout parameters, and the default View onMeasure implementation affects how that child is laid out.

In this lesson you will learn:

The process by which a parent and child determine the child’s size on the screen.
The different classes used by parent and child views to communicate requested sizes and size constraints.
How well the View base class’s onMeasure implementation sizes its content for some combinations of layout parameters.
Why it’s important to implement onMeasure for your own custom views




There are no comments on this lesson, start the conversation below ...

You need to go PRO to post comments.

Lessons in Custom Views and ViewGroups