http://www.cnblogs.com/x-dev/p/3767538.html?utm_source=tuicool&utm_medium=referralPublic Final int getmeasuredheight () 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 int getheight () 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:
<xmlns:android= "http://schemas.android.com/apk/res/android" android:layout_width= " Match_parent " android:layout_height=" 240dip " android:cliptopadding=" false " android:scrolly ></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)
The difference between getmeasuredheight () and GetHeight ()