i override background color of actionbar style.xml code:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="apptheme" parent="android:theme.material.light.darkactionbar"> <item name="android:statusbarcolor">@color/colorprimarydark</item> <item name="android:actionbarstyle">@style/myactionbar</item> </style> <!-- action bar --> <style name="myactionbar" parent="android:theme.material.light.darkactionbar"> <item name="android:background">@color/colorprimary</item> </style> </resources> the code main activity here :
public class mainactivity extends activity { private actionbar mactionbar; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mtitles = firstitem.gettitle(); //setting title of first item /** * action bar customization */ mactionbar = getactionbar(); //latest mactionbar.settitle(" latest"); // set first title mactionbar.setdisplayhomeasupenabled(true); // enabling action bar app icon , behaving toggle button mactionbar.setdisplayshowhomeenabled(false); // hide tha app icon action bar mactionbar.sethomebuttonenabled(true); } the problem can't see text of action bar if set color style.xml . futhermore can't use things :
<item name="android:textcolorprimary">@color/row_child_menu_title</item> or
<item name="android:coloraccent">@color/row_child_menu_title</item> the result same. text being disappeared , menu icons , toggle icon visible
thanks in advance
Comments
Post a Comment