How do i change the color of the background where it says "add contact" and "about". Now its kind of grayish, but i want it to be white! This is a actionBar with dropdown, not a spinner. And im not using that actionbarsherlock thing.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- Illegal to have multiple roots (start tag in epilo
- How to maintain order of key-value in DataFrame sa
For example, in you exisiting parent
Style
definition, add just theandroid:popupMenuStyle
attribute as shown below:And override the
android:popupMenuStyle
attribute by defining your style:The
@drawable/menu_dropdown_panel_example
is this:You can either choose to use an image similar to the one above, or use an
Color
resource.And this is for the default ActionBar. Not the
ActionBarSherlock
. ;-)ActionBar
styles can be easily created using this cool website: http://jgilfelt.github.com/android-actionbarstylegenerator/. I usually experiment a little here before deciding on the style. Plus, it lets you download the styles and all necessary resources. Just plug them in your app and you are good to go. :-)UPDATED: I think I caused some confusion which has resulted in the loss of the shadow on your app's drop-down. You may have replaced all the
<items>
in yourStyle
that I listed in the original suggestion. The edit should fix that.UPDATE 2:
Use these image resources instead of the
@android:color/white
value you are currently using. These are in the order of XHDPI, HDPI and MDPI. Save them and use them in the Style definition.You can simple override itemBackground item in your theme:
Try to get styles from ActionBarStyleGenerator service. It has preview and makes all necessary drawable, xml and styles. There you can easily find and change required color and then find it in sources (in your case it is android:popupBackground).