经过长时间的Googleing和测试,我想到了这个:
的themes.xml:
<style name="Apptheme" parent="Holo.theme"> <item name="androID:popupMenuStyle">@style/PopupMenuStyle</item> <item name="popupMenuStyle">@style/PopupMenuStyle</item></style><style name="PopupMenuStyle" parent="@style/Widget.Sherlock.PopupMenu"> <item name="androID:dropDownSelector">@drawable/menu_selector</item></style>
menu_selector.xml :(如abs__List_selector_holo_dark.xml)
<?xml version="1.0" enCoding="utf-8"?><selector xmlns:androID="http://schemas.androID.com/apk/res/androID"> <item androID:state_window_focused="false" androID:drawable="@androID:color/transparent" /> <item androID:state_focused="true" androID:state_enabled="false" androID:state_pressed="true" androID:drawable="@drawable/abs__List_selector_Disabled_holo_dark" /> <item androID:state_focused="true" androID:state_enabled="false" androID:drawable="@drawable/abs__List_selector_Disabled_holo_dark" /> <item androID:state_focused="true" androID:state_pressed="true" androID:drawable="@color/AppRed" /> <item androID:state_focused="false" androID:state_pressed="true" androID:drawable="@color/AppRed" /> <item androID:state_focused="true" androID:drawable="@drawable/abs__List_focused_holo" /> <item androID:drawable="@color/AppRed" /></selector>
不幸的是,背景仍然变为蓝色而不是红色.
我在这里失踪了什么?
http://jgilfelt.github.io/android-actionbarstylegenerator/
总结以上是内存溢出为你收集整理的android – ActionBar menuitem按下背景颜色全部内容,希望文章能够帮你解决android – ActionBar menuitem按下背景颜色所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)