There is an xml file. There is a RelativeLayout in it, and there are 2 RelativeLayouts in it (Red and Blue)

enter image description here

The height of the latter should be equal to half the height of the screen of the phone. That is - half of the screen is red, half of the screen is blue) Maybe? If so, how?

    1 answer 1

    Make the parent container LinearLayout-ohm and set the same weight descendants.

    Or programmatically measure the screen and set the parameters in runtime

    Or use PercentLayout