本文介绍了如何在Xamarin.Forms ToolbarItem中添加菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一种向我的ToolbarItem添加菜单的方法.现在,它只是可点击的文本,这是我尝试创建的示例,
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>
推荐答案
您应该能够将ToolBarItem
的order
设置为Secondary
,以将选项强制进入Android的溢出菜单:
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>
这篇关于如何在Xamarin.Forms ToolbarItem中添加菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!