如何在Xamarin.Forms ToolbarItem中添加菜单? [英] How to add a menu to a Xamarin.Forms ToolbarItem?

查看:461
本文介绍了如何在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>

推荐答案

您应该能够将ToolBarItemorder设置为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中添加菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆