2014-09-02 28 views
3

在我的应用程序中,我有一个自定义可复选框,并且它在常规界面区域默认工作,但它在溢出菜单中没有出现可检查项目时显示,相反,它显示默认的holo复选框!Android ActionBar溢出复选框样式

enter image description here

这里是定制的复选框enter image description here

下面是我已经能够样式溢出菜单的例子(痛苦地硬),我正在寻找像一个风格这如果覆盖在你的主题android:listChoiceIndicatorMultiple将覆盖复选框

<style name="OverflowMenu" parent="@style/Widget.Sherlock.ListPopupWindow"> 
    <item name="android:popupBackground">@drawable/pop_dark</item> 
</style> 

<style name="DropDownListView" parent="@android:style/Widget.Holo.ListView.DropDown"> 
    <item name="android:divider">@android:color/transparent</item> 
</style> 
+0

你有没有想过这个? – 2014-09-28 07:38:35

+0

不,不幸的是,我认为唯一的解决方案是手动实现一个弹出菜单,并有一个自定义列表项。但是这显然在整个项目中非常耗时。 – Derek 2014-09-28 07:45:37

+0

感谢您的快速回复。如果我知道了,我会回到这里。 – 2014-09-28 07:50:35

回答

3

,它将适用于所有的复选框,那些在您的正常UI作为WEL l由于在弹出菜单那些,即

<style name="AppTheme" parent="android:Theme..."> 
    <item name="android:listChoiceIndicatorMultiple">@style/YourCheckBoxStyle</item> 
</style> 

如果你只想主题在你的动作条的复选框,然后就可以使用android:actionBarWidgetTheme因为API 14:

<style name="AppTheme" parent="android:Theme..."> 
    <item name="android:actionBarWidgetTheme">@style/MyActionBarWidgetScheme</item> 
</style> 
... 
<style name="ActionBarWidgetTheme" parent="android:Widget"> 
    <item name="android:listChoiceIndicatorMultiple">@drawable/YourCheckBoxStyle</item> 
</style> 

(荣誉丹尼尔·卢pointing that one out