0

I am new to custom renderers and can only do basic things like customizing entries, pickers etc. I am really trying to implement an android toolbar menu into my navbar on x.forms and I know I will need to do this through a custom renderer.

I just really do not know where to start. It has proven difficult to find what I need online so I am hoping someone could point me in the right direction.

What I want is something that looks like this: enter image description here

Which simply drops down and presents a list of options. Thanks in advance.

steve
  • 797
  • 1
  • 9
  • 27

2 Answers2

0

If you don't need it on iOS then all you need to do is:

<ToolbarItem Title="title" Order="Secondary"/>

If you need it on iOS then even Custom Renderer won't help you.

Ivan Ičin
  • 9,672
  • 5
  • 36
  • 57
  • I saw this during my searches, I do not think it works for Xamarin 4.0+ with AppShell because it does not show an overflow menu. It simply shows the items. Can you confirm please? – steve Sep 13 '19 at 19:24
  • Do you know the iOS equivalent? As in what they use instead, or what the common practice for that is? Thanks – steve Sep 16 '19 at 20:20
0

As lvan said, if you want to implement this like picture, you just add ToolbarItem for ContentPage.

<ContentPage.ToolbarItems>
    <ToolbarItem
        Name="MenuItem1"
        Order="Secondary"
        Priority="0"
        Text="Item 1" />
    <ToolbarItem
        Name="MenuItem2"
        Order="Secondary"
        Priority="1"
        Text="Item 2" />

</ContentPage.ToolbarItems>

You don't need to custom render.

enter image description here

You can take a look the following article for more info.

https://xamarinhelp.com/xamarin-forms-toolbar/

Cherry Bu - MSFT
  • 10,160
  • 1
  • 10
  • 16
  • I saw that website when I was trying to make this work, like I replied to Evan above, I do not think this works for Xamarin.Forms Shell. Maybe I am doing something wrong but I tried it and it shows the full item names. – steve Sep 13 '19 at 19:27
  • @Do you want to add toolbaritem in xamarin.forms shell? If yes, I suggest you can use menu item in shell, you can take a look:https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/shell/flyout – Cherry Bu - MSFT Sep 17 '19 at 06:02
  • Thanks, but thats involving a flyout and is entirely different from what my question is asking. I simply stopped using Xamarin Forms Shell for now, the menu item (on the navigation bar) issue is currently open and I believe Microsoft is actively working on it. – steve Sep 17 '19 at 16:23
  • @steve, **I simply stopped using Xamarin Forms Shell for now, the menu item (on the navigation bar) issue is currently open and I believe Microsoft is actively working on it.** I am not sure what you say, you mean that this feature that you require , Microsoft is working? – Cherry Bu - MSFT Sep 24 '19 at 09:24