Win10 UWP系列:更新UWP时注意的问题——TargetDeviceFamily
前几天把CurrencyExchanger提交到微软参加Master认证,结果没有通过,反馈了一些错误,看来微软检查还是比较仔细的。
错误主要有:
Visual feedback helps users recognize whether their interactions with your application are detected, interpreted, and handled as they intended.
就是说如果一个列表项点击后没有任何动作的话,不应该有触摸反馈。UWP的ListView项默认会带Tilt效果,以前WP8的时候还要通过另外的Toolkit来实现,现在自带了,反而要想办法去掉。解决办法是自定义ListView的ItemContainerStyle,去掉里面的VisualStateGroup就可以了。
再一个错误:
Windows 10 applications should properly navigate back through pages when using the Windows 10 system back button.
在开发的时候主要针对PC和手机来进行了测试,手机有硬件返回键,所以处理了返回键的事件,PC没有返回键,就没做,但PC有一个平板模式,是可以显示返回键的,这个地方也需要处理。解决办法是增加处理SystemNavigationManager.GetForCurrentView().BackRequested事件即可。
再一个错误是功能性的,搜索货币时无法正常搜索,经检查代码是搜索内容忘了进行大小写转换,可以搜索小写字母,大写字母就搜不到了,属于粗心错误。统一ToUpper或者ToLower就可以了。
还有一个错误是这样的:
The following recommendation is optional and not required for STARTS compliance. With Windows 10 developers can write a single application that can be installed across a variety of device families including Mobile, Desktop, and XBOX. By default, Windows 10 applications target all device families. In the application manifest, this is called out as the ‘Universal’ Target Device Family. Such applications will be tested against all device form factors where this application may be deployed. Alternatively, developers can limit the device families for which an application can be deployed. For example, if ‘Desktop’ is specified and the Target Device Family, that application can only be installed on PC devices. When published, this application will only be available in the Store running on PCs – it will not be available in the Phone store.
The manifest file has Universal as TargetDeviceFamily. The application currently targets only desktop and mobile. It is recommended that the manifest entry is restricted only to supported devices and that a minimum of two device families are supported.
意思是说既然只支持PC和Mobile,就不要把TargetDeviceFamily设置为Universal。我就想当然的在Package.appsmanifest文件里修改了TargetDeviceFamily,设置为只有Desktop和Mobile。
还有一个错误:
The application should adapt properly to portrait or landscape view if supported.
这个是因为在635等分辨率低的机型上运行时,部分字体被截断了。而且在横屏的时候计算器界面也没显示完全。所以发布时应尽可能测试不同分辨率机型保持界面可用性。我调整了国旗图标大小,并且只支持竖屏状态,去掉了横屏支持。
然后顺手修复了几个小bug,开始上传商店。上传后在分析包的过程中出现以下错误:
XD.UWP.CurrencyExchanger_3.1.3.0_x86_x64_arm_bundle.appxupload28.0 MB
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?