Reputation: 1
Is there a way to have the toolbaritems display right below the navigation bar? I also noticed that when I click a button within my toolbar to navigate to a new page the toolbar floats to the topleft corner of my phones screen and then disappears. I'm not sure why it does that and I would much rather have it simply disappear right away. I'm currently testing the toolbar on the android platform. Below is what it currently looks like.
Upvotes: 0
Views: 507
Reputation: 9084
Is there a way to have the toolbaritems display right below the navigation bar?
In Xamarin.Forms
, you could use ToolbarItem to implement this feature.
If you want display ToolbarItem
at the right corner, set the order
of the ToolBarItem
to Secondary
to force the option into an overflow menu on Android :
<ContentPage.ToolbarItems>
<ToolbarItem Text="Share" Activated="EditClicked_Share" Order="Secondary" />
<ToolbarItem Text="Create" Activated="EditClicked_Create" Order="Secondary" />
</ContentPage.ToolbarItems>
Effect :
If you want display ToolbarItem
right below the navigation back button,
<ContentPage.ToolbarItems>
<ToolbarItem Text="Share" Activated="EditClicked_Share" Order="Primary" Priority="0" />
<ToolbarItem Text="Create" Activated="EditClicked_Create" Order="Primary" Priority="1" />
<ToolbarItem Text="Save" Activated="EditClicked_Save" Order="Primary" Priority="2" Icon="ic_action_content_save.png" />
</ContentPage.ToolbarItems>
Effect :
Remember to wrap your Modal in a NavigationPage, as the ToolbarItems
otherwise will not appear. For more information, you could refer to the article and this question.
Upvotes: 2