Tablayou的指示器setSelectedTabIndicator不顯示了
網(wǎng)上說是變量改了
解決方法在xml里添加此代碼
```xml
?app:tabIndicator="@drawable/tabs_rounded_line_indicator"
```
tabs_rounded_line_indicator.xml
```xlm
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
? ? <item
? ? ? ? android:left="4dp"
? ? ? ? android:right="4dp">
? ? ? ? <shape
? ? ? ? ? ? android:shape="rectangle">
? ? ? ? ? ? <solid android:color="?attr/main_bg_color"/>
? ? ? ? ? ? <corners
? ? ? ? ? ? ? ? android:bottomLeftRadius="0dp"
? ? ? ? ? ? ? ? android:bottomRightRadius="0dp"
? ? ? ? ? ? ? ? android:topLeftRadius="3dp"
? ? ? ? ? ? ? ? android:topRightRadius="3dp"/>
? ? ? ? ? ? <size
? ? ? ? ? ? ? ? android:height="3dp"/>
? ? ? ? </shape>
? ? </item>
</layer-list>
```
? 指示器寬度跟隨文本寬度
```xml
app:tabIndicatorFullWidth="false"
```
不放效果圖的一律當水帖處理