更改xamarin表单android中列表视图的上下文操作菜单背景颜色

更改xamarin表单android中列表视图的上下文操作菜单背景颜色,xamarin,xamarin.forms,xamarin.android,menuitem,Xamarin,Xamarin.forms,Xamarin.android,Menuitem,在列表视图中长按Viewcell时,上下文操作出现在xamarin forms(android)中。我需要把背景颜色改成红色,有没有可能的解决办法 提前感谢。是的,可以更改背景颜色。 在Android上,ContentAction是通过ActionModes实现的,所以只需在Android项目的样式中设置Android:actionModeBackground <?xml version="1.0" encoding="utf-8"?> <resources> &

在列表视图中长按Viewcell时,上下文操作出现在xamarin forms(android)中。我需要把背景颜色改成红色,有没有可能的解决办法


提前感谢。

是的,可以更改背景颜色。
在Android上,ContentAction是通过ActionModes实现的,所以只需在Android项目的样式中设置Android:actionModeBackground

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyTheme.Light" parent="@android:style/Theme.Holo.Light.DarkActionBar">
        <item name="android:actionModeBackground">@color/ActionModeColor</item>
    </style>
</resources>

@颜色/动作模式颜色

从列表视图上下文创建标题菜单的自定义对象,然后更改颜色属性。试试看:我没有得到u@Love KeshNope,我想你找错了。我需要更改我以红色突出显示的关联菜单颜色的颜色,如果您的情况是更改ListView中所选项目的颜色,您有解决该问题的方法吗?谢谢您的帮助!要让它在所有设备上运行,包括pre Lollipop,您需要删除android前缀:
@color/ActionModeColor