如何在 Windows Phone 8 应用程序的应用程序栏中隐藏/显示图标按钮? [英] How to hide/show the icon button from the application bar in windows phone 8 apps?

查看:28
本文介绍了如何在 Windows Phone 8 应用程序的应用程序栏中隐藏/显示图标按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 Windows Phone 8 开发应用程序.我的问题是我无法从应用程序栏中隐藏/显示图标按钮.如果有的话,谁告诉我答案.

I am developing an application for windows phone 8. My problem is I could't hide/show an icon button from the application bar. Any one tell me the answer if you have.

推荐答案

我们无法直接访问应用程序栏的可见性属性,所以另一种方法是在不需要时删除图标并在需要时重新添加.

We can't access direclty the visibilty propety of application bar,and so other way is remove icon when u no need it and add it again when you need it.

要删除第一个应用图标,

To Remove first appicon,

ApplicationBar.Buttons.RemoveAt(0);

添加,

ApplicationBarIconButton b = new ApplicationBarIconButton();
b.Text = i.ToString();
b.IconUri = new Uri("/Images/icon1.png", UriKind.Relative);
ApplicationBar.Buttons.Add(b);

这篇关于如何在 Windows Phone 8 应用程序的应用程序栏中隐藏/显示图标按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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