elDoudou wrote:
> I have a RelativeLayout made of three widgets (named 1, 2 and 3 on the
> illustrations below): one attached to its parent left border (labelled
> 1), one to its parent right border (labelled 2) and the third
> (labelled 3) inserted between the 2 previous ones (its left border is
> attached to the first widget right border, and its right border is
> attached to the second widget left border). The third widget (the
> middle/central one laballed "3") is far taller than the two others,
> and I would like the first and second items (1 and 2) to be vertically
> centered with the middle widget.
> 
> I have resorted to the "android:layout_centerVertical" attribute for
> both the first and second widget, but I do not get the expected
> result. See at the bottom the various layouts I'm mentionning. Could
> someone please help me, and tell me whether what I intend to do is
> feasible, and how? Thank you for your time.

android:layout_centerVertical says to center vertically in its parent,
not with respect to some other widget. Since you did not post the layout
files here, and you did not post screenshots somewhere, it is difficult
to tell from your ASCII art what is going on.

> What I'd like:
>   ---
> --|3|--
> |1|3|2|
> --|3|--
>   ---

Some ideas:

Option #1: Use a horizontal LinearLayout with appropriate
android:layout_gravity attributes

Option #2: Use android:layout_centerVertical on all three widgets, not
just two, plus no other layout attributes that affect their vertical
positions

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Development Wiki: http://wiki.andmob.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to