I have a TextView control which is being placed in a custom ViewGroup
which places the control at a certain position and size.  I want to
center the text vertically within that control.  I am making the call:

tv.setGravity(Gravity.CENTER_VERTICAL);

but the text still remains aligned to the top of the TextView box
(note that if I set it to be centered horizontally, that works).

Now if I take that same TextView and simply set it as the main view
(e.g. setContentView(tv)), the vertical centering works fine.  Is
there something that my custom ViewGroup must do to get the vertical
centering to work?

Thanks.

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

Reply via email to