android - ActionBar Fill Entire Bar (No Grey Background) -
need help
i can't title bar/action bar change colour red (#ff0000), remains grey.
styles:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="themeselector" parent="android:theme.holo.light"> <item name="android:actionbarstyle">@style/actionbar</item> </style> <style name="actionbar" parent="android:style/widget.holo.actionbar"> <item name="android:background">#ff0000</item> </style> </resources>
update: (mainfest)
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.twostarii.actionbardemo" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="11" android:targetsdkversion="19" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/themeselector" > <activity android:name="com.twostarii.actionbardemo.mainactivity" android:label="@string/app_name" android:theme="@android:style/theme" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application>
you can set color action bar @ dynamically,
public actionbar mactionbar; mactionbar = getactionbar(); mactionbar.setbackgrounddrawable(new colordrawable(0xff00dded)); mactionbar.setdisplayshowtitleenabled(false); mactionbar.setdisplayshowtitleenabled(true);
or @ static , should add style on manifest.xml as,
android:theme="@style/themeselector"
for activity
Comments
Post a Comment