<Button
android:id="@+id/btn_home"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/main_bottom_item_bg"
android:drawableTop="@drawable/tab_home_bg"
android:onClick="onTabClicked"
android:paddingBottom="2dip"
android:paddingTop="7dip"
android:scaleType="matrix"
android:text="@string/home"
android:textColor="@color/button_text"
android:textSize="12sp" />

修改button背景:background
背景颜色的文件名:main_bottom_item_bg
<selector xmlns:android="http://schemas.android.com/apk/res/android">
//android:state_selected="true"为选中时显示
<item android:drawable="@color/common_bottom_bar_selected_bg" android:state_selected="true"/>
<item android:drawable="@color/common_bottom_bar_normal_bg"/>
</selector>

修改当前button 图标:drawableTop
文件名:tab_home_bg
<selector xmlns:android="http://schemas.android.com/apk/res/android">
//android:state_selected="true"为选中时显示
<item android:drawable="@drawable/bot_zhuye_h_icon" android:state_selected="true"/>
<item android:drawable="@drawable/bot_zhuye_icon"/>
</selector>

更多相关文章

  1. Android(安卓)ListView 去除边缘阴影、选中色、拖动背景色、行高
  2. 对话框式activity
  3. ExpandableListView设置选中child的背景
  4. Android(安卓)API 中文(77)——AdapterView.OnItemSelectedListene
  5. android之4.0控件switch自定义开关滑块、滑块轨道和宽度
  6. LinearLayout按下(pressed)或获取焦点(focused)时背景设置不同颜
  7. android背景选择器selector用法汇总
  8. Android(安卓)读取 assets目录下的文件
  9. android图标的制作

随机推荐

  1. android 图片Bitmap的旋转
  2. Android系列教程之五:Activity的生命周期
  3. Android单元测试—UI测试(Espresso)
  4. android RelativeLayout常用属性
  5. 学习Content Provider
  6. Android的SoundPool
  7. Android通过Aidl调用Service实例
  8. Android 图片异步加载的体会,SoftReferenc
  9. Android中用ViewPager和Fragment内嵌WebV
  10. 获取开发版SHA1双击signingReport无效问