TabLayout添加分割线
来源:互联网 发布:我的世界pe服务器端口 编辑:程序博客网 时间:2024/06/06 08:23
为TabLayout添加分割线,显示的效果如下(红框内部分):
首先添加个竖线xml名为layout_divider_vertical:
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#80c0c0c0"/> <size android:width="1dp"/></shape>
在代码中引用:
LinearLayout linearLayout = (LinearLayout) mTabLayout.getChildAt(0); linearLayout.setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE); linearLayout.setDividerDrawable(ContextCompat.getDrawable(this, R.drawable.layout_divider_vertical));
mTabLayout就是要添加分割线的控件
4 0
- TabLayout添加分割线
- Android TabLayout添加自定义分割线并且可以修改分割线高度
- TabLayout设置标签分割线
- TextView添加分割线
- GridView添加分割线
- RecycleView添加分割线。
- Recycleview添加分割线
- LinerLayout 添加分割线
- RecycleView添加分割线
- RecycleView添加分割线
- RecyclerView添加分割线
- recyclerview添加分割线
- RecyclerView添加分割线
- RecyclervIew添加分割线
- 添加分割线
- 添加分割线
- Android Design TabLayout 使用与分割线
- Android Linearlayout 添加分割线
- 程序员必须牢记的12个修复bug关键步骤
- RHCE
- <mvc:annotation-driven />注解意义
- Django models 拆分
- Oracle错误记录
- TabLayout添加分割线
- 使用GitHub、Composer、Packagist管理公开的PHP包(Step By Step)
- app集成地图,跳转第三方地图导航 整理
- 代码混淆
- 原型模式(python)
- angular2系统学习 ------杂项
- Android 混合开发 相关
- 集体智慧编程 第三章 发现群组
- 打包错误:`Error:Execution failed for task ':app:lintVitalRelease'.