Android Design TabLayout 使用與分割線
阿新 • • 發佈:2018-12-14
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