【发布时间】:2021-08-25 01:48:18
【问题描述】:
我是 Android 开发的菜鸟。
如何删除或更改选项菜单顶部和底部条的颜色?
我已将<item name="android:itemBackground">@color/AraLightBlue</item> 输入到“themes.xml”文件中。
效果很好。
我创建了这个样式(square_menu.xml)
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="0dp"/>
<padding
android:top="0dp"
android:bottom="0dp"
/>
</shape>
并添加
<style name="ThemeOverlay.MyTheme" parent="ThemeOverlay.AppCompat.Light">
<item name="android:itemBackground">@color/AraLightBlue</item>
<item name="android:popupBackground">@drawable/square_menu</item>
</style>
到主题.xml
并添加
app:popupTheme="@style/ThemeOverlay.MyTheme"
到activity_main.xml。
我错过了什么?
【问题讨论】:
标签: android xml customization