<?xml version= "1.0" encoding= "Utf-8"? ><tabhost xmlns:android= "Http://schemas.android.com/apk/res/android "Android:id=" @android: Id/tabhost "android:layout_alignparentbottom=" true "android:layout_width=" Fill_parent " android:layout_height= "Fill_parent" > <linearlayout android:layout_width= "fill_parent" Android:layo ut_height= "fill_parent" android:orientation= "vertical" > <framelayout android:id= "@android: Id/tabcontent "android:layout_width=" fill_parent "android:layout_height=" 0.0dip "Android: layout_weight= "1.0"/> <tabwidget android:id= "@android: Id/tabs" android:layout_width= "Fill_parent" android:layout_height= "wrap_content" android:layout_weight= "0.0" android:visibility= "Gone"/> <RadioGroup Android:id= "@+id/radiogroup" android:layout_width= "fill_parent" android:layout_height= "60DP" android:layout_gravity="Bottom" android:gravity= "left" android:background= "@drawable/bg_bottom_tab" Android:orie ntation= "Horizontal" > <radiobutton android:id= "@+id/homepage" style= "@style/bot Tom_tab_style "android:drawabletop=" @drawable/bg_tab_homepage "android:tag=" homepage " android:text= "@string/homepage"/> <radiobutton android:id= "@+id/sell" s tyle= "@style/bottom_tab_style" android:drawabletop= "@drawable/bg_tab_homepage" android:tag= "S Ell "android:text=" @string/sell "/> <radiobutton android:id=" @+id/buy " style= "@style/bottom_tab_style" android:drawabletop= "@drawable/bg_tab_homepage" Android : tag= "Buy" android:text= "@string/buy"/> <radiobutton android:id= "@+id/donate" Style= "@styLe/bottom_tab_style "android:drawabletop=" @drawable/bg_tab_homepage "android:tag=" Donate " android:text= "@string/donate"/> <radiobutton android:id= "@+id/more" St yle= "@style/bottom_tab_style" android:drawabletop= "@drawable/bg_tab_homepage" android:tag= "M Ore "android:text=" @string/more "/> </RadioGroup> </LinearLayout></TabHost>
Configuration in Styles.xml
<style name= "Bottom_tab_style" > <item name= "android:textsize" >15.0dip</item> <item Name= "Android:textcolor" > #ffffffff </item> <item name= "Android:gravity" >center_horizontal< /item> <item name= "Android:background" > @drawable/selector_radiobutton</item> <item Name= "Android:paddingtop" >8.0dip</item> <item name= "Android:button" > @null </item> <item name= "Android:layout_weight" >1.0</item> <item name= "android:drawablepadding" >5.0dip </item>
Selector_radiobutton.xml
<?xml version= "1.0" encoding= "Utf-8"? ><selector xmlns:android= "http://schemas.android.com/apk/res/ Android "> <item android:drawable=" @drawable/bg_tab_radiobutton_s "android:state_enabled=" true "Android: State_focused= "true" android:state_pressed= "false"/> <item android:drawable= "@drawable/bg_tab_ Radiobutton_d "android:state_enabled=" true "android:state_pressed=" true "/> <item android:drawable=" @ Drawable/bg_tab_radiobutton_d "android:state_enabled=" true "android:state_checked=" true "/></selector>
[Android] Tab