How to add a menu to a Xamarin.Forms ToolbarItem?

馋奶兔 提交于 2019-12-21 05:39:14

问题


I am looking for a way to add a menu to my ToolbarItem. Right now its just clickable text, here is an example of what I am trying to create,

Here is what I have so far:

<ContentPage.ToolbarItems>
        <ToolbarItem Text="{Binding EditButtonText, Mode=TwoWay}" Clicked="EditClicked" />
    </ContentPage.ToolbarItems>

回答1:


You should be able to set the order of the ToolBarItem to Secondary to force the option into an overflow menu on Android:

<ContentPage.ToolbarItems>
        <ToolbarItem Text="{Binding EditButtonText, Mode=TwoWay}" Clicked="EditClicked" Order="Secondary" />
</ContentPage.ToolbarItems>



来源:https://stackoverflow.com/questions/32523578/how-to-add-a-menu-to-a-xamarin-forms-toolbaritem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!