Measure View Height Android

[Solved] Measure View Height Android | Swift - Code Explorer | yomemimo.com
Question : measure view height android

Answered by : kushal

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);
}
});

Source : | Last Update : Sat, 06 Mar 21

Answers related to measure view height android

Code Explorer Popular Question For Swift