TabLayout文本突出显示

时间:2015-09-19 18:50:46

标签: android android-layout

我的风格如下

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

        <!--for globalApp-->
        <item name="android:background">@color/gray50</item>
        <!--for fab-->
        <item name="colorPrimaryDark">@color/gray900</item>

        <!--for tabLayout-->
        <item name="android:textColorPrimary">@color/gray50</item>
        <item name="android:textColorSecondary">@color/gray400</item>
        <item name="colorAccent">@color/deepOrangeA400</item>
    </style>


    <style name="Base.Widget.Design.TabLayout" parent="android:Widget">
        <item name="tabIndicatorColor">?attr/colorAccent</item>
        <item name="tabIndicatorHeight">4dp</item>
        <item name="tabPaddingStart">12dp</item>
        <item name="tabPaddingEnd">12dp</item>
        <item name="tabBackground">?attr/colorPrimaryDark</item>
        <item name="tabTextAppearance">@style/AppTheme.TextAppearance.Design.Tab</item>
        <item name="tabSelectedTextColor">?android:textColorPrimary</item>
    </style>

    <style name="AppTheme.TextAppearance.Design.Tab" parent="TextAppearance.AppCompat.Button">
        <item name="android:textSize">12sp</item>
        <item name="android:textColor">?android:textColorSecondary</item>
        <item name="textAllCaps">true</item>
    </style>


</resources>

我的布局如下

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.app.form.HomeActivity"
    android:id="@+id/root_coordinator"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include layout="@layout/select_form_type" />

</android.support.design.widget.CoordinatorLayout>

select_form_type.xml

<android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/select_form_tab"

    android:layout_width="match_parent"
    android:layout_height="wrap_content"

    app:tabIndicatorHeight="4dp"
/>

当我运行应用程序时,由于某种原因,我的标签文本会突出显示。以下是我的文字的外观: http://imgur.com/BfhyiUI http://postimg.org/image/j335xzlql/

如何删除文字高亮显示? 这也是组织样式的最佳方式吗?

0 个答案:

没有答案