2014-06-29 149 views

回答

4

我有同樣的問題。您可以通過將此代碼添加到styles.xml中並在清單文件中使用它來更改文本大小和顏色。對我來說,它的工作。

<style name="AppTheme" parent="AppBaseTheme"> 
    <item name="android:popupMenuStyle">@style/PopupMenu</item> 
    <item name="android:textAppearanceLargePopupMenu">   @style/myPopupMenuTextAppearanceLarge</item> 
    <item name="android:textAppearanceSmallPopupMenu">   @style/myPopupMenuTextAppearanceSmall</item> 

    <!-- All customizations that are NOT specific to a particular API-level can go here. --> 
</style> 

<style name="PopupMenu" parent="@android:style/Widget.PopupMenu"> 
    <item name="android:popupBackground">@android:color/white</item> 
    <item name="android:textColor">#FF01F0</item> 
    <item name="android:textSize">12sp</item> 
</style> 


<style name="myPopupMenuTextAppearanceSmall" parent="@android:style/TextAppearance.DeviceDefault.Widget.PopupMenu.Small"> 
<item name="android:textColor">#545656</item> 
<item name="android:textSize">15sp</item> 
</style> 
<style name="myPopupMenuTextAppearanceLarge" parent="@android:style/TextAppearance.DeviceDefault.Widget.PopupMenu.Large"> 
<item name="android:textColor">#545656</item> 
<item name="android:textSize">25sp</item> 
</style>