【WP8.1】系统控件的bug及修复方案
2015-03-06 19:43
316 查看
最近开发的时候,发现Windows Phone 8.1 Runtime中的两个控件的存在bug的情况,现总结出来,并给出解决方案。
ImageBug后台
测试效果:
出现了其中一幅无法加载的情况
而我们的调试窗口也显示出了无法加载的信息。
1、Hub控件
Hub控件的顶部默认是可以拖动来切换HubSection的:using System.Diagnostics; using Windows.Phone.UI.Input; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; // “空白页”项模板在 http://go.microsoft.com/fwlink/?LinkID=390556 上有介绍 namespace BugDemo { /// <summary> /// 可用于自身或导航至 Frame 内部的空白页。 /// </summary> public sealed partial class ImageBugPage : Page { private string[] _testUrl = new string[]{ "http://www.bing.com/az/hprichbg/rb/DragonFlyBeijing_ZH-CN8555054089_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/MidAutumnFestivalHongKong_ZH-CN9020398465_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/MusulmokBeach_ZH-CN12849119858_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/BetulaVerrucosa_ZH-CN9596215235_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/HoluhraunVolcano_ZH-CN10866460287_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/SouthernElephantSeal_ZH-CN11868940461_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/YokoteKamakura_ZH-CN11459129782_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/SpottedLakeCanada_ZH-CN12374082037_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/StKildaBay_ZH-CN12275183653_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/SellinPier_ZH-CN9832633239_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/RNPFogVideo_ZH-CN8941485556_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/PaperFansRedLanterns_ZH-CN9355904288_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/NinthEmperorGodTemple_ZH-CN13109315006_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/ChineseDecorationTiger_ZH-CN13118003712_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/NewYearPinwheels_ZH-CN12259065748_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/NewYearOrnaments_ZH-CN10726465661_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/DadaochengFireworks_ZH-CN10749562397_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/SummerVacation_ZH-CN10164213926_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/InsideRhoneGlacier_ZH-CN10709433723_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/BodleianLibrary_ZH-CN13371852606_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/HeartNebula_ZH-CN7750020667_150x150.jpg", "http://www.bing.com/az/hprichbg/rb/HotAndCold_ZH-CN8140560654_150x150.jpg" }; public ImageBugPage() { this.InitializeComponent(); } /// <summary> /// 在此页将要在 Frame 中显示时进行调用。 /// </summary> /// <param name="e">描述如何访问此页的事件数据。 /// 此参数通常用于配置页。</param> protected override void OnNavigatedTo(NavigationEventArgs e) { HardwareButtons.BackPressed += HardwareButtons_BackPressed; } protected override void OnNavigatedFrom(NavigationEventArgs e) { HardwareButtons.BackPressed -= HardwareButtons_BackPressed; } private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e) { if (Frame.CanGoBack) { e.Handled = true; Frame.GoBack(); } } private void BtnLoad_Click(object sender, RoutedEventArgs e) { lvwImage.ItemsSource = _testUrl; } private void Image_ImageFailed(object sender, ExceptionRoutedEventArgs e) { Debug.WriteLine(e.ErrorMessage); } } }
ImageBug后台
测试效果:
出现了其中一幅无法加载的情况
而我们的调试窗口也显示出了无法加载的信息。
解决方案:捕获到加载失败时,重新设定Image控件的Source属性。
修改上面的后台代码中的ImageFailed方法:PS:暂时未知win8.1 store app上也是否会出现这个问题,有时间的博友可以帮忙测试一下。
最后附上测试的代码及解决的代码的整个工程:BugDemo.zip相关文章推荐
- [golang] Glide 包管理工具,在windows10 64位系统上的bug修复方案
- 修复BUG:dotFlexGird v1.22beta 争取做ASP.NET中最好的Ajax开源表格控件
- 修复bug,增加BasePath参数 - dotnetFlexGrid 1.21beta更新 争取做ASP.NET中最好的Ajax开源表格控件
- 修复duilib库UISlider控件的4个bug
- 仿酷狗音乐播放器开发日志二十三 修复Option控件显示状态不全的bug(附源码)
- 仿酷狗音乐播放器开发日志二十三 修复Option控件显示状态不全的bug(附源码)
- TabControl控件BUG与配置系统未能初始化错误
- [WP8.1UI控件编程]Windows Phone动画方案的选择
- 修复duilib库UISlider控件的4个bug
- [WP8.1UI控件编程]Windows Phone动画方案的选择
- WP8.1 控件默认字体颜色 配置文件位置
- openx开源广告系统修复中文乱码bug问题
- android系统sqlite数据库注入漏洞及修复方案
- Ubuntu U盘启动盘修复更新后无法启动系统的bug
- 修复duilib库UISlider控件的4个bug
- Delphi中MediaPlayer控件的一个Bug即修复
- 黄聪:wordpress3.4修复WP No Category Base插件无法去掉category的Bug
- [正式发布]库存管理系统v1.1!修复大量BUG,以及UI显示!
- duilib修复ActiveXUI控件bug,以支持flash透明动态背景
- 构建基于WinRT的WP8.1 App 03:Page控件