Android ActionBar Tab Style -



Android ActionBar Tab Style -

i know there ample questions on subject can't work color staying default blue. i'm trying alter highlight color of tabs. i've followed tutorial (http://blog.alwold.com/2013/08/28/styling-tabs-in-the-android-action-bar/).

now in values/styles.xml have next code:

<resources> <!-- base of operations application theme, dependent on api level. theme replaced appbasetheme res/values-vxx/styles.xml on newer devices. <item name="android:actionbarstyle">@style/actionbarwithouttitle</item> --> <style name="appbasetheme" parent="theme.appcompat.light"> <item name="android:actionbartabstyle">@style/myactionbar</item> <item name="actionbartabstyle">@style/myactionbar</item> </style> <!-- application theme. --> <style name="apptheme" parent="appbasetheme"> <!-- customizations not specific particular api-level can go here. --> </style> <style name="myactionbar" parent="theme.appcompat.light.darkactionbar"> <item name="android:background">@drawable/tab_bar_background</item> <item name="background">@drawable/tab_bar_background</item> </style>

apart have drawable state list plus 2 others setting colours. importantly have set theme in androidmanifest.xml (appbasetheme) so:

<application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/appbasetheme" > <activity android:name="com.stevesandco.miajournal.mainactivity" android:label="@string/app_name" android:screenorientation="portrait" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application>

i understand in values-v11 , values-v14 folders, styles corresponding android version should added. problem when adding <item name="android:background">@drawable/tab_bar_background</item> values-v14\styles.xml app crashes. i'm not sure whether i'm missing it's simple thing might have forgot.

values-v11\styles.xml:

<!-- base of operations application theme api 11+. theme replaces appbasetheme res/values/styles.xml on api 11+ devices. --> <style name="appbasetheme" parent="theme.appcompat.light"> <!-- api 11 theme customizations can go here. --> <item name="background">@drawable/tab_bar_background</item> </style>

values-v14\styles.xml:

<!-- base of operations application theme api 14+. theme replaces appbasetheme both res/values/styles.xml , res/values-v11/styles.xml on api 14+ devices. --> <style name="appbasetheme" parent="theme.appcompat.light.darkactionbar"> <!-- api 14 theme customizations can go here. --> <item name="android:background">@drawable/tab_bar_background</item> </style>

android android-actionbar android-tabs android-styles

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -