Android tabs textcolor selector ignores state_pressed

依然范特西╮ 提交于 2019-12-06 02:13:15

Review the Customize the Text Color section of the ActionBar Styling documentation - it mentions that Note: The custom style applied to titleTextStyle should use TextAppearance.Holo.Widget.ActionBar.Title as the parent style. - perhaps a change there might help correct the problem.

Another place to look would be here under the Example theme section - it shows an example of android:actionBarTabTextStyle that might help get things sorted for you.

Try this in the drawable folder:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_enabled="true">
        <shape>
            <corners android:radius="0dp" />
            <solid android:color="@color/white" />
            <stroke android:width="1dp" android:color="@color/color_700" />
            <padding android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp" />
        </shape>
    </item>
    <item android:state_enabled="false">
        <shape>
            <corners android:radius="0dp" />
            <solid android:color="@color/color_100" />
            <stroke android:width="1dp" android:color="@color/bloqueado" />
            <padding android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp" />
        </shape>
    </item>

</selector>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!