android style中使用app:的属性
0x0001
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.TabLayout
android:id="@+id/history_tab_layout"
style="@style/history_tab_title_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:background="@color/white_color"
app:tabIndicatorHeight="5dp"
app:tabMode="fixed"
app:tabTextColor="@color/black" />
<com.agfa.android.arziroqrplus.ui.views.MyViewPager
android:id="@+id/history_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
0x0002 style 中
<style name="history_tab_title_color" parent="Widget.Design.TabLayout">
<item name="tabIndicatorColor">@color/c1f5fac</item>
<item name="tabSelectedTextColor">@color/c1f5fac</item>
</style>
注意:
1. parent=”Widget.Design.TabLayout”, 从哪个包引的控件,就引谁的父类
2. name=”tabIndicatorColor” 不带app: