<?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 studio 工程在android 源码编译
  2. android 界面组件添加定制属性
  3. 一针见血的看待房地产
  4. Android: 调试C++代码
  5. Android学习:TextUtils类介绍
  6. Android(安卓)RecyclerView 滑动到指定it
  7. Android(安卓)屏幕截图
  8. Android快速开发框架dyh详解(五)---基础
  9. 【android studio】解决layout预览出现Re
  10. Android:解决TextView设置textIsSelectabl