<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabBackground="#ff0000"
/>
报错信息如下:
Android resource linking failed
counter_fragment_with_tab.xml:12: AAPT: error: '#ff0000' is incompatible with attribute tabBackground (attr) reference [weak].
改在color.xml中定义颜色后,问题解决:
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabBackground="@color/colorPrimary"
/>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<