Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Showing Secondary ToolBar items - best way?

$
0
0

I use two devices for testing my app:

  1. Phone(Android 4.0.3). It has a hardware button menu
  2. Tablet(Android 4.2.2). It has no hardware button menu.

This is code my ToolBars

  <ToolbarItems >  
    <ToolbarItem Text="Action1"  Order="Primary" />
    <ToolbarItem Text="Action2"  Order="Secondary" />
    <ToolbarItem Text="Action3"  Order="Secondary" />
 </ToolbarItems>

When I run app on the phone button with secondary items not showing.

I need to press the menu button that would showing secondary items.
When I run app on the tablet button with secondary items showing. This is normal?
I tried to use this code:

           ViewConfiguration config = ViewConfiguration.Get(this);
            Field menuKeyField = config.Class.GetDeclaredField("sHasPermanentMenuKey");

            if (menuKeyField != null)
            {
                menuKeyField.Accessible = true;
                menuKeyField.SetBoolean(config, false);
            }

I first run app on the phone button with secondary items not showing. Second and other run - button with secondary items showing.
But this hack. The default behavior of the application is that normal? What do you do in this case?


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>