Android Design TabLayout 使用与分割线

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013148839/article/details/74858163

WX20170709-113112@2x.png

   LinearLayout linearLayout = (LinearLayout) mTbTitle.getChildAt(0);
                linearLayout.setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);
                linearLayout.setDividerPadding(40); // 设置分割线的pandding
                linearLayout.setDividerDrawable(ContextCompat.getDrawable(getContext(),
                        R.drawable.sp_exposure_select));

文件 sp_exposure_select

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#757575"/>
    <size
        android:width="1dp"
        />

</shape>

参考
http://www.jianshu.com/p/2b2bb6be83a8

猜你喜欢

转载自blog.csdn.net/u013148839/article/details/74858163