Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Context Actions show above instead of hiding Navigation Bar


I've got the issue listed in the title and shown in the screenshots. I've also tested the interactiveListView sample project by adding a MasterDetail Page as MainPage, but the Context Actions show up fine there.

Any ideas why this is happening in my project?

Relevant code:

public partial class Menu : MasterDetailPage
        MasterPage masterPage;
        Type typeRole;
        string typePage;

        public Menu (string type)
            InitializeComponent ();

            BindingContext = new CarouselViewModel ();

            typePage = type;

            masterPage = new MasterPage (type);
            Master = masterPage;

            if (type == "PT") {
                Detail = new NavigationPage (new DashBoard ());
                typeRole = typeof(DashBoard);
            } else if (type == "PTClient") {
                Detail = new NavigationPage (new DashBoardPTClient ());
                typeRole = typeof (DashBoardPTClient);

            masterPage.ListView.ItemTapped += OnItemTapped;
            masterPage.imageTap.Tapped += OnImageSelected;


        void OnItemTapped (object sender, ItemTappedEventArgs e)
            var item = e.Item as MasterPageItem;

            if (item.TargetType == typeof (DashBoard)) {
                if (typeRole == typeof (DashBoard)) {
                    Detail = new NavigationPage (new DashBoard ());
                } else if (typeRole == typeof (DashBoardPTClient)) {
                    Detail = new NavigationPage (new DashBoardPTClient ());
            } else if (item.TargetType == typeof (BlankDialogPage)) { 
                Detail = new NavigationPage (new BlankDialogPage ());
              else if (item.TargetType == typeof (ContactListPage)) {
                Detail = new NavigationPage (new ContactListPage ());

            masterPage.ListView.SelectedItem = null;
            IsPresented = false;


  • AdamMeaneyAdamMeaney USMember ✭✭✭✭✭

    I believe in my application, adding the following to the styles.xml fixed the issue.

    <style name="ContextActionMode" parent="@style/Widget.AppCompat.ActionMode">
        <item name="background">@color/primary</item>

    and in the style you are using in your main activity

    <item name="actionModeStyle">@style/ContextActionMode</item>
  • rafael.pereirarafael.pereira BRMember
    edited November 2016

    Thanks for the reply, Adam.

    I had

     item name="android:actionModeBackground"

    for the background color, so I commented it and went with your style to no effect, it just colored the bar like mine :/

    Still no idea why it's behaving this way.

  • rafael.pereirarafael.pereira BRMember
    edited November 2016

    Just found it out !

    I was missing the property below on my MainActivity style:

     <item name="windowActionModeOverlay">true</item> 

    Now I have to find out how to change the status bar background color on the action mode overlay :p

    PS: How do I mark this post as the answer?

Sign In or Register to comment.