I have a view view1
which extends FrameLayout and overrides onMeasure() like this, so that it is rendered as a square:
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, widthMeasureSpec);
}
Now I want to create another view view2
which extends view1
, but now I want view2
to have a height equal to the parent, and hence to cover the full screen. As of now, I get it as a square too.
How do I achieve this?