【问题标题】:Change Contextual Action Bar Overflow Style更改上下文操作栏溢出样式
【发布时间】:2016-05-12 14:54:39
【问题描述】:

我想更改上下文操作栏溢出区域的样式(文本和/或背景颜色)。

目前文本颜色取自当前主题中的 android:textColor,但我想为溢出下拉菜单使用不同的颜色。

我可以使用 android:actionModeBackground 更改 CAB 的背景颜色,但不能更改溢出区域。

我目前的风格是这样的:

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="windowActionModeOverlay">true</item>
    <item name="android:textColor">#3e3e3e</item>

</style>

有什么想法吗?

谢谢

【问题讨论】:

  • 请把你的一些代码,比如 style.xml

标签: android


【解决方案1】:

使用以下项目

   <item name="actionOverflowMenuStyle">@style/LStyled.PopupMenu.OverflowMenu</item>

并定义样式 LStyled.PopupMenu.OverflowMenu

<style name="LStyled.PopupMenu.OverflowMenu" parent="@style/Widget.AppCompat.PopupMenu.Overflow">
  <item name="android:popupBackground">@drawable/bground</item>
 </style>

【讨论】:

  • 谢谢。正是我想要的
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-04-01
相关资源
最近更新 更多