I have a RelativeLayout (that I am not married to) and two TextViews. I would like the bottom of the first TextView to line up with the center of it’s parent, and the top of the second TextView to line up with the center of it’s parent.

I put a green line in the picture above at the (vertical) center of the parent. The TextViews are currently in exactly the right spot, but I did this as I will describe below with margin’s and aligning them to the parent and knowing the parent’s size.
For various reasons I can’t use just one TextView and center it. Also I don’t know the height of the parent, so I can’t align each to the top/bottom of the parent and margin them down/up to center them.
I also tried having another View that takes up half the height and be invisible, but layout_height doesn’t take percents (or at least it gave me errors).
Any ideas how I can accomplish this?
Should I just put the two TextViews inside another layout and have that center itself?
Create a 0-height view that is centered in its parent and serves as an anchor. (Use the attribute
android:layout_centerVertical="true"for this.) Position one text view above the anchor and the other below the anchor.