2012-02-24 57 views

回答

0

您将需要添加/属性 安卓popupMenuStyle & 安卓dropDownListViewStyle 你的主题。他们需要指出两种可以自定义溢出的样式。

<style name="MyTheme" parent="Theme.Sherlock.Light"> 
    <!-- Action bar styles --> 
    <item name="android:popupMenuStyle">@style/NTCPopupMenu</item> 
    <item name="android:dropDownListViewStyle">@style/NTCDropDownListView</item> 
    <item name="popupMenuStyle">@style/NTCPopupMenu</item> 
    <item name="dropDownListViewStyle">@style/NTCDropDownListView</item> 
</style> 

和风格

<!-- overflow menu --> 
<style name="MyPopupMenu" parent="@style/Widget.Sherlock.Light.ListPopupWindow"> 
    <item name="android:popupBackground">@drawable/background</item> 
</style> 

<!-- style the items within the overflow menu --> 
<style name="MyDropDownListView" parent="@style/Widget.Sherlock.Light.ListView.DropDown"> 
    <item name="android:divider">@drawable/divider</item> 
    <item name="android:listSelector">@drawable/item_background</item> 
</style> 

有一个在这个例子中从ActionBarSherlock网站上的例子不同的一件事,那就是我的主题有不同的父。看到不同的帖子在这里: ActionbarSherlock overflow menu styling issue