2012-02-24 23 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