简体   繁体   English

如何隐藏Xamarin.Forms UWP中的默认工具栏按钮(三个点)

[英]How do I hide the default toolbar button (three dots) in Xamarin.Forms UWP

I have a Xamarin.Forms UWP app with a <ContentPage.ToolbarItems> defined with two toolbarItems. 我有一个Xamarin.Forms UWP应用程序,其中<ContentPage.ToolbarItems>使用两个toolbarItems定义。 In UWP this toolbar renders but displays an extra (or default) button with 3 dots that expands but does not contain any buttons. 在UWP中,此工具栏呈现但显示一个额外的(或默认)按钮,其中3个点可以展开,但不包含任何按钮。 I want to remove this extra button. 我想删除这个额外的按钮。

I found some references on this problem but they didn't work for me: 我找到了一些关于这个问题的参考资料,但它们对我不起作用:

As per the answer in the link that you mentioned in your post, did you tried to put below code in your App.Xaml of your UWP project: 根据您在帖子中提到的链接中的答案,您是否尝试将下面的代码放在您的UWP项目的App.Xaml中:

<Application.Resources>
   <x:Double x:Key="AppBarExpandButtonThemeWidth">0</x:Double>
</Application.Resources>

Since Windows 10 Anniversary Edition ( so your project's min version is 14393 and target version is 14393 or greater ) there is a property on the CommandBar that you can use to toggle the visibility of the 3 dots/more button. 自Windows 10周年纪念版(因此您的项目的最小版本为14393,目标版本为14393或更高版本)后,CommandBar上有一个属性可用于切换3点/更多按钮的可见性。

It's call OverflowButtonVisibilty and the docs are here: https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.commandbar.overflowbuttonvisibility 它的调用是OverflowButtonVisibilty,文档在这里: https//docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.commandbar.overflowbuttonvisibility

You can set it like so 你可以像这样设置它

<CommandBar OverflowButtonVisibility="Collapsed"></CommandBar>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Xamarin 中显示带有三个点的工具栏? - How can I display a toolbar with three dots in Xamarin? 如何更改 Xamarin.Forms UWP 应用程序的强调色? - How do I change the accent colour of a Xamarin.Forms UWP application? 如何使图像显示在我的 Xamarin.Forms 应用程序的 UWP 版本中 - How do I make images show up in UWP version of my Xamarin.Forms application 如何在 Xamarin.Forms 中创建平行四边形按钮 - How do you create a parallelogram button in Xamarin.Forms 如何在 xamarin.forms 中的 viewcell 中设置按钮以从内容页面 viewmodel 调用命令? - How do I set a button in viewcell in xamarin.forms to call a command from the content page viewmodel? 如何在 Xamarin.Forms 页面中将 Button 作为 CommandParameter 从 XAML 传递? - How do I pass the Button as CommandParameter from XAML in a Xamarin.Forms Page? 如何使用 C# 停止按钮执行 Xamarin.Forms 中的绑定命令? - How do I stop a button from executing a bound command in Xamarin.Forms using C#? Xamarin.Forms:处理导航工具栏按钮(外壳) - Xamarin.Forms: Handle Navigation toolbar button (Shell) 在 Xamarin.Forms UWP 应用程序中拦截鼠标后退按钮 - Intercepting the Mouse back button in a Xamarin.Forms UWP App 如何在Xamarin.Forms的TabbedPage的选项卡中放置按钮? - How can I place a button in the the tabs of a TabbedPage in Xamarin.Forms?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM