Tablayout 里面的tab 显示的时候靠近在一起的解决办法
2016-04-26 15:32
429 查看
在使用Tablayout 的时候,里面的tab 显示的时候靠近在一起的
解决办法 1:只要设置一个参数就可以了:app:tabGravity="fill"
<android.support.design.widget.TabLayout
android:id="@+id/recharge_tablayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabBackground="@color/background"
app:tabIndicatorColor="@color/btn_blue"
app:tabIndicatorHeight="2dp"
app:tabGravity="fill"
android:layout_marginBottom="1dp">
如果第一种办法不能解决,很有可能超出了它的默认的宽度,这个时候设置最大的宽度就可以了.
解决办法 2:就是设置app:tabMinWidth="200dp",以及 app:tabMaxWidth="200dp"
d="@+id/recharge_tablayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorColor="@color/btn_blue"
app:tabMinWidth="200dp"
app:tabMaxWidth="200dp"
>
相关文章推荐
- 北京林业大学“计蒜客”杯程序设计竞赛 网络赛 A. 喝酒
- 2016亚太CIO领袖峰会
- codeforces Round #256
- SQL基本语句总结
- spring 技术内幕--IOC初始化过程深入之BeanDefinition的载入和解析1
- Android手机用WIFI与Android studio连接,真机测试APP
- 新手seoer怎样恰到好处的展开日常优化工作
- TestNg常用注解
- iOS跳转App Store应用评论页
- 【web service调用】 抓取资源
- RequireJS 配置理解
- 加入购物车动画
- (4.4.14.1)Android_关于子控件和父控件的事件响应问题
- Android平台的跨进程通信——AIDL(上)
- SharedPreferenceUtils
- python-rrdtool安装
- 5--TCP的状态
- 自我实现一个简洁版的String类――1
- 新站上线前SEO需要做的工作列表
- libcurl快速入门