android RadioButton image and text

eleveViagma

New Member
Im using a radio button to create a custom tab host, is working fine, but now I need to show the icon on top and the text underneath the icon,this is what I have now:
sV1O8.png
but this is what I need:
gf1zd.png
This is my code: \[code\] <RadioButton android:id="@+id/rad_home" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="@drawable/rad_background" android:button="@drawable/home_icon" android:gravity="center" android:text="Home" android:textColor="@drawable/text_background" android:textSize="@dimen/rad_text_size" > </RadioButton> <RadioButton android:id="@+id/rad_1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="@drawable/rad_background" android:button="@null" android:gravity="center" android:text="Menu" android:textColor="@drawable/text_background" android:textSize="@dimen/rad_text_size" /> <RadioButton android:id="@+id/rad_2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="@drawable/rad_background" android:button="@null" android:gravity="center" android:text="VIP" android:textColor="@drawable/text_background" android:textSize="@dimen/rad_text_size" /> <RadioButton android:id="@+id/rad_3" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="@drawable/rad_background" android:button="@null" android:gravity="center" android:text="About" android:textColor="@drawable/text_background" android:textSize="@dimen/rad_text_size" /> <RadioButton android:id="@+id/rad_4" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="@drawable/rad_background" android:button="@null" android:gravity="center" android:text="Whats On" android:textColor="@drawable/text_background" android:textSize="@dimen/rad_text_size" /></RadioGroup>\[/code\]So im setting the button icon with:\[quote\] android:button="@null"\[/quote\]for when is emptyand \[quote\] android:button="@drawable/home_icon"\[/quote\]for the icon image,should I use this to set the icon? how to organize it as I need it? [icon on top, text bottom]I tried with a layout inside , but doesnt seem to like it?how to accomplish this?thanks!
 
Back
Top