Android风格的弹出菜单ingnored
为了改变弹出菜单的颜色,我尝试用这种方式定义我的自定义主题,在我的应用程序中编辑样式文件 V11和v14的My styles.xml如下所示Android风格的弹出菜单ingnored,android,Android,为了改变弹出菜单的颜色,我尝试用这种方式定义我的自定义主题,在我的应用程序中编辑样式文件 V11和v14的My styles.xml如下所示 <resources> <!-- Base application theme for API 14+. This theme completely replaces AppBaseTheme from BOTH res/values/styles.xml and res/valu
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.NoTitleBar">
<!-- API 14 theme customizations can go here. -->
<item name="android:popupMenuStyle">@style/MyPopupMenu</item>
<item name="android:dropDownListViewStyle">@style/MyDropDownListView</item>
<item name="android:actionDropDownStyle">@style/MyDropDownNav</item>
</style>
<!-- style the list navigation -->
<style name="MyDropDownNav" parent="android:style/Widget.Holo.Light.Spinner">
<item name="android:background">#ffffff</item>
<item name="android:popupBackground">#8044ff</item>
<item name="android:dropDownSelector">#ff7700</item>
</style>
<!-- style the overflow menu -->
<style name="MyPopupMenu" parent="android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:popupBackground">#8044ff</item>
</style>
<!-- style the items within the overflow menu -->
<style name="MyDropDownListView" parent="android:style/Widget.Holo.ListView.DropDown">
<item name="android:listSelector">#8044ff</item>
</style>
</resources>
@样式/MyPopupMenu
@样式/MyDropDownList视图
@样式/MyDropDownNav
#ffffff
#8044ff
#ff7700
#8044ff
#8044ff
清单中的活动
<activity
android:name=".Home"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/AppBaseTheme" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
不幸的是,所有这些定制似乎都被忽略了。如何解决此问题?在活动标记中使用所需的主题名称 目前您正在使用android:theme=“@style/AppBaseTheme” 不要使用android:theme=“@style/your\u theme\u name” 您的主题名称可能是:MyDropDownNav或MyPopupMenu或MyDropDownList视图