我想设置菜单窗格的背景是不透明的。很多但是搜索和尝试的事情,我几乎可以得到它的工作通过设置'panelFullBackground,之后,我得到失去了菜单面板的顶部边缘以及它的阴影效果的不想要的结果。我猜测,仅通过设置颜色,我失去了与panelFullBackground相关的其他样式。
I'm trying to set the background of the menu pane to be opaque. After a lot of searching and trying out things I can almost get it working by setting 'panelFullBackground', however, I get the unwanted result of losing the top edge of the menu pane along with its shadow effect. I'm guessing that by just setting the color I'm losing additional styles associated with 'panelFullBackground'.
我设置我的应用程序有一个自定义样式。风格继承Theme.Light。 在我的风格,我的设置panelFullBackground到自定义颜色,如下所示:
I've set my application to have a custom style. The style inherits from Theme.Light. In my style I'm setting 'panelFullBackground' to a custom color as follows:
在stylex.xml:
In stylex.xml:
<item name="android:panelFullBackground">@color/custom_theme_color</item>在colors.xml
In colors.xml
<color name="custom_theme_color">#ff00ffff</color>
我已经使用panelColorForeground试图|背景,但他们没有达到我想要的
I've tried using panelColorForeground|Background but they do not achieve what I want.
值得一提的,我试图用setMenuBackground做法在其他地方建议无济于事。
It should be mentioned that I tried to use the setMenuBackground approach suggested elsewhere to no avail.
在此先感谢。
推荐答案可以从 @Color 值设置为 @drawable 像下面这为我工作:
You can value from @color to @drawable like below which worked for me:
<style name="MyTheme" parent="@android:style/Theme.Holo.Light"> <!-- Menu Style --> <item name="android:panelBackground">@drawable/blue_background</item> </style>更多推荐
设置菜单背景是不透明
发布评论