Public Final intGetmeasuredheight()Added in API Level 1
Like getMeasuredHeightAndState()
, but only returns the raw width component (which is the result of masked by MEASURED_SIZE_MASK
).
Returns
- The raw measured height of this view.
Public Final intgetheight()Added in API Level 1
Return the height of your view.
Returns
- The height of your view, in pixels.
Getmeasuredheight () returns the original measurement height, regardless of the screen, and GetHeight () returns the height displayed on the screen. In fact, when the screen can wrap the content, their values are equal, only when the view beyond the screen to see their differences. When the screen is exceeded, getmeasuredheight () equals getheight () plus the height that is not displayed outside the screen.
Cases:
< relativelayout xmlns:android = "http:// Schemas.android.com/apk/res/android " Android:layout_width " Span style= "Color:rgb (0, 0, 255); >= "Match_parent" Android:layout_height = "240dip" android:cliptopadding = "false" android:scrolly = "50dip" </ relativelayout
Here it is set to a height of 240dip, exceeding the screen 50dip.
Getmeasuredheight () Gets the size of 240dip. (converted to pixel values)
GetHeight () Gets the size of the 240dip-50dip. (converted to pixel values)