底部导航栏
来源:互联网 发布:绿联mac网线usb驱动 编辑:程序博客网 时间:2024/05/29 14:27
//文字颜色
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:color="#3F51B5"/> <item android:state_checked="false" android:color="#8f8f8f"/></selector>//替换图片@drawable/shou<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:state_checked="false" android:drawable="@drawable/syb"/>未选中状态 <item android:state_checked="true" android:drawable="@drawable/syh"/>选中状态 <item android:drawable="@drawable/syb"/>默认状态</selector>
//底部导航栏
<RadioGroup android:id="@+id/rg" android:paddingTop="5dp" android:background="#f4f5f6" android:gravity="center" android:layout_width="match_parent" android:layout_height="40dp" android:orientation="horizontal" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true"> <RadioButton android:id="@+id/rb" android:gravity="center" android:button="@null" android:drawableTop="@drawable/shou" android:layout_width="0dp" android:layout_weight="1" android:layout_height="match_parent" android:textColor="@drawable/selector_tab_color" /> <RadioButton android:id="@+id/rb1" android:gravity="center" android:button="@null" android:drawableTop="@drawable/wei" android:layout_width="0dp" android:layout_weight="1" android:layout_height="match_parent" android:textColor="@drawable/selector_tab_color" /> <RadioButton android:id="@+id/rb2" android:gravity="center" android:button="@null" android:drawableTop="@drawable/deng" android:layout_width="0dp" android:layout_weight="1" android:layout_height="match_parent" android:textColor="@drawable/selector_tab_color" /> </RadioGroup>
//将RadioButton添加进数组
int[] rid={R.id.rb,R.id.rb1,R.id.rb2};RadioGroup rg= (RadioGroup) findViewById(R.id.rg);
for(int j=0;j<rid.length;j++){ RadioButton rb= (RadioButton) findViewById(rid[j]);}
阅读全文
0 0
- android底部导航栏
- android底部导航栏
- 底部导航栏封装
- 底部导航栏实现
- Android底部导航栏
- 底部导航栏FragmentTabHost
- android 底部导航栏
- tablayout底部导航栏
- 底部导航栏(五个)
- 底部导航栏FragmenTabHost
- android底部导航栏
- BottomNavigationBar底部导航栏
- 底部导航栏
- 底部导航栏
- 底部导航栏
- 底部导航栏
- 底部导航栏
- 底部导航栏
- <input type="file">系列文章一(上)
- 泛微java笔试
- 简单的公告墙HTML+CSS样式+angular.js
- EduSoho系统用户的批量导入(mysql操纵)
- CF D. Sorting the Coins
- 底部导航栏
- 内网客户 通过 公网域名/ip 访问内网web服务器 出错
- Unity基础3_3D数学基础
- ndoejs中设置http响应跨域
- 我和Git有个约会之SourceTree
- mysql中外键的作用
- Mybatis教程____#{params}和${params}使用
- svn 合并主干分支的问题
- 遍历Map的三种方法