steve
steve

Reputation: 927

Android toolbar menu Xamarin Forms custom renderer [NOT RESOLVED]

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.

Upvotes: 0

Views: 1361

Answers (2)

Cherry Bu - MSFT
Cherry Bu - MSFT

Reputation: 10356

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/

Upvotes: 0

Ivan I
Ivan I

Reputation: 9990

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.

Upvotes: 0

Related Questions