Kevin J. Brooks wrote:
> However now I have another problem maybe someone can help.  In the
> following I want to align the Texview in the vertical center of the
> ImageButton.  However it isn't working.  Any ideas?
> 
> <ImageButton android:id="@+id/btnBeer"
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:layout_below="@id/currentBAC"
>       android:src="@drawable/beer2" />
> <TextView adnroid.id="@+id/tvBeer"    
>       android:layout_width="wrap_content"
>       android:layout_height="wrap_content"
>       android:layout_toRightOf="@id/btnBeer"
>       android:layout_centerVertical="@id/btnBeer"
>       android:textColor="#000000"
>       android:text="@string/beertxt" />

1. adnroid.id="@+id/tvBeer" should be android:id="@+id/tvBeer".

2. I do not think there is a way to center one widget relative to
another widget -- only centering a widget within the parent. Hence, you
may need to wrap your ImageButton and TextView in their own
RelativeLayout and set both of them to android:layout_centerVertical="true".

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

_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

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

Reply via email to