c# - XAML - 应用栏中菜单项下的额外空间 [英] c# - XAML - extra space under menu items in app bar
问题描述
每当我在应用栏中添加菜单项时,菜单项下都会出现额外的行或空格.我不知道如何删除它.它真的很烦人.在此,我已按图像添加了该菜单.请帮我摆脱那些多余的空间.
Whenever i added the menu items in app bar, an extra line or space is coming under the menu items. I don't know how to remove it. It really disturbs look a lot. herewith i have added that menu by image. Kindly, help me to get rid of that extra space.
我的 XAML 代码:
My XAML CODE:
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar Mode="Default" Opacity="1.0" IsMenuEnabled="True" IsVisible="True">
<shell:ApplicationBarIconButton IconUri="/Assets/folder.png" Text="about" Click="more1"/>
<shell:ApplicationBarIconButton IconUri="/Assets/next.png" Text="goto" Click="gotopage"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="rate this app" Click="rateapp"/>
<shell:ApplicationBarMenuItem Text="like us" Click="like"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
通过上面的代码输出应用程序栏:
OUTPUT APP BAR BY ABOVE CODE:
推荐答案
据我所知,当有 2 个或更少的菜单项时,应用程序栏的默认行为是有这个空间.您可以通过添加另一个菜单项(提供帮助或关于我们或其他内容)来摆脱空间,以便您拥有 3 个菜单项,或者通过创建自己的应用程序栏.不过,对于这么小的问题,第二条路线似乎有点过分了.
To my knowledge, it's the default behavior of the application bar to have this space when there are 2 or less menu items. You can get rid of the space by adding another menu item (throw in a help or about us or something) so that you have 3 menu items, or by creating your own application bar. The second route seems really overkill for such a small issue though.
这篇关于c# - XAML - 应用栏中菜单项下的额外空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!