How to change ContextActions MenuItem color?

MarcusRungeMarcusRunge DEMember ✭✭✭
edited August 2017 in Xamarin.Forms

Hello,
I have this XAML:
<ViewCell.ContextActions>
< MenuItem Text="Löschen" Command="{Binding RemoveUserTimerCommand}" IsDestructive="True"/>
< MenuItem Text="Sync" Command="{Binding SyncUserTimerCommand}" />
</ViewCell.ContextActions>
How do I change the "Sync" item background from grey to blue in iOS?
Can it be done with StyleId? If yes, how and where?

Best Answer

  • MarcusRungeMarcusRunge DE ✭✭✭
    Accepted Answer

    After researching forever, it's one line of Code:
    In styles.xml add to your app style:
    < item name="actionModeBackground">@android:color/black
    or
    < item name="actionModeBackground">@color/primary
    (@color/primary is defined in Colors.xml)

Answers

  • MarcusRungeMarcusRunge DEMember ✭✭✭
    Accepted Answer

    After researching forever, it's one line of Code:
    In styles.xml add to your app style:
    < item name="actionModeBackground">@android:color/black
    or
    < item name="actionModeBackground">@color/primary
    (@color/primary is defined in Colors.xml)

  • bifedefrangobifedefrango Member ✭✭
    edited May 17

    <item name="android:actionModeBackground">@color/colorPrimary</item>

Sign In or Register to comment.