当前位置:编程学习 > wap >>

Windows Phone开发之ApplicationBar简介

说明:在WP开发过程中,ApplicationBar一般不大常用,在MainPage布局文件上一般被注释掉的。
[html]
<!--演示 ApplicationBar 用法的示例代码--> 
 <phone:PhoneApplicationPage.ApplicationBar> 
       <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"> 
          <shell:ApplicationBarIconButton  
                   IconUri="/Images/SplashScreenImage.png"  
                   Text="按钮一"/> 
               <shell:ApplicationBarIconButton  
                   IconUri="/Images/SplashScreenImage.png"  
                   Text="按钮二"/>          
               <shell:ApplicationBar.MenuItems> 
               <shell:ApplicationBarMenuItem Text="菜单项 1"/> 
               <shell:ApplicationBarMenuItem Text="菜单项 2"/> 
           </shell:ApplicationBar.MenuItems> 
       </shell:ApplicationBar> 
   </phone:PhoneApplicationPage.ApplicationBar> 

注意与解释:
用法很简单,有Click属性,与其他控件使用没有两样。
IconUri="/Images/SplashScreenImage.png"首先,注意此处的路径表示与Image中source表示方法不同,然后注意图片大小。
<shell:ApplicationBarIconButton />最多只能有四个,多了会报错。
<shell:ApplicationBarMenuItem Text="菜单项 1"/>没有数量限制。

 


摘自 whuarui2010的专栏

补充:移动开发 , Windows Phone ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,