按钮-Windows Phone应用 [英] Buttons - Windows Phone App
问题描述
我想知道,我没有足够的空间在应用程序的网格上放置额外的按钮.我注意到,当我为Windows 8开发Metro风格的应用程序时,有一个应用程序栏.当您右键单击该应用程序栏时,就会显示出一个用于存储额外内容的地方 纽扣. Windows Phone上有吸吮的东西吗?
I was wondering, i have ran out of space to put extra buttons on a grid in my app. I noticed that when i was developing for metro style apps for windows 8, there is an app bar. That comes up when you right click, that app bar, is a place to store extra buttons. Is there suck thing on the windows phone?
如何使用XAML代码创建一个?
How do i create one using XAML code?
请,谢谢您
推荐答案
当然可以! 它的方式类似于Windows 8中的方式(另一种方式是Win8中的方式受此启发).
Sure there is! Its in a way similar to the one in Windows 8 (other way around as the one in Win8 is inspired by this one).
应用程序栏最多可容纳4个按钮和一堆菜单项(不确定多少).使用4个按钮显示主要内容,并在菜单项中添加诸如关于,设置,反馈等内容.
The Application bar can hold up to 4 buttons and a bunch of menu items (not sure how many). Use the 4 buttons for main stuff and in the menu items put stuff like about, settings, feedback, etc.
以下是应用栏的基本XAML:
Here is the basic XAML for the app bar:
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
<shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="MenuItem 1"/>
<shell:ApplicationBarMenuItem Text="MenuItem 2"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
它应该已经在xaml中了(末尾有注释). 如果没有,那么您拥有它.
It should already be in the xaml (commented at the end). If not then there you have it.
祝你好运
Harold(Zumicts-创始人)
Harold (Zumicts - Founder)
这篇关于按钮-Windows Phone应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!