Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

measure view height android

ViewTreeObserver vto = frameAbout.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {

int width = frameAbout.getMeasuredWidth();
int height = frameAbout.getMeasuredHeight();
ViewGroup.LayoutParams params = fakeheight.getLayoutParams();
params.height = height - 200;
fakeheight.setLayoutParams(params);
}
});
 
PREVIOUS NEXT
Tagged: #measure #view #height #android
ADD COMMENT
Topic
Name
9+3 =