在Windows Phone 8.1中检测屏幕大小 [英] Detecting Screen Size in Windows Phone 8.1

查看:98
本文介绍了在Windows Phone 8.1中检测屏幕大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将所有Windows Phone 7应用升级到Windows Phone 8.1。由于Windows Phone 7始终具有相同的屏幕尺寸,因此我无需担心用户使用的设备。但现在我需要检测屏幕大小,以便我可以修改布局。我找到的许多
页面告诉我使用System.Windows.Application.Current.Host.Content.ScaleFactor,但这似乎不可用(至少我找不到它)。如何确定用户的Windows Phone设备的大小?谢谢。



Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

解决方案

< blockquote>

鉴于您正在升级WP7应用程序,我猜您使用的是Silverlight 8.1应用程序模型而不是WinRT商店应用程序。您可能需要查看本文在Nokia Developer Wiki上定义的ResolutionHelper类:

http://developer.nokia.com/community/wiki/Advanced_Techniques_for_Big_UI


希望有所帮助。


I am upgrading all my Windows Phone 7 apps to Windows Phone 8.1. Because Windows Phone 7 always had the same screen size, I didn't need to worry about what device the user had. But now I need to detect the screen size so that I can modify the layout. Many pages I have found tell me to use System.Windows.Application.Current.Host.Content.ScaleFactor, but that doesn't seem to be available (at least I can't find it). How can I determine the size of the user's Windows Phone device? Thanks.


Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

解决方案

Given that you are upgrading WP7 Apps I guess you are using the Silverlight 8.1 App Model and not WinRT Store Apps. You might want to take a look at the ResolutionHelper class defined in this article on the Nokia Developer Wiki: http://developer.nokia.com/community/wiki/Advanced_Techniques_for_Big_UI

Hope it helps.


这篇关于在Windows Phone 8.1中检测屏幕大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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