<?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:layout_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:orientation="horizontal" >           <RadioButton            android:id="@+id/homepage"                style="@style/bottom_tab_style"                android:drawableTop="@drawable/bg_tab_homepage"                android:tag="HomePage"                android:text="@string/HomePage" />          <RadioButton            android:id="@+id/sell"                style="@style/bottom_tab_style"               android:drawableTop="@drawable/bg_tab_homepage"                android:tag="Sell"                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"                style="@style/bottom_tab_style"                android:drawableTop="@drawable/bg_tab_homepage"                android:tag="More"                android:text="@string/More" />   </RadioGroup>    </LinearLayout></TabHost>

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>














更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. [Android]Error:Unknown host 'maven.oa.
  2. Android5.0通知变化浅析-最近在Android5.
  3. Android(安卓)RILD运行机制详解
  4. Out Of Memory Error in Android(安卓)-
  5. U3D不同平台载入XML文件的方法——IOS MA
  6. Android中Dialog自带蒙层适配状态栏
  7. Android(安卓)go 自定义静态广播接收不到
  8. edit text 及 text view 属性
  9. Listview 去除分割线、操作各种默认背景
  10. 在Ubuntu 16.04上为树莓派(RaspBerry Pi