I have a RelativeLayout (I'm not married) and two TextView s. I would like the bottom of the first TextView line up with its parent center, and the top of the second TextView line up with its parent.

I put the green line in the picture above in the (vertical) center of the parent. TextView is currently in the right place, but I did it as I will describe below using a field and matching with the parent and knowing the size of the parent.
For various reasons, I cannot use only one TextView and center it. In addition, I do not know the height of the parent, so I can not align them with the top / bottom of the parent and lower them up / down to center them.
I also tried to have another View that takes up half the height and will be invisible , but layout_height does not accept percentages (or at least it gave me errors).
Any ideas how I can do this?
Should I just put two TextView inside another layout and have this center?
source share