Windows Phone 7 - 设备独立像素?
Android 有一种很好的方法来使屏幕元素可缩放,以便它们在大多数设备上看起来都很好。其中之一是设备独立像素: device-independent-pixels 的基础知识
Windows Phone 7 上是否有类似于下降的内容?
如何根据其内容自动调整控件大小?比如width=wrap_content?
谢谢!
Android has a nice way to make screen elements scaleable so they look good on most devices. One of those is Device Independent Pixels:
basics of device-independent-pixels
Is there anything similar to dips on Windows Phone 7?
What about autosizing a control to its contents? Such as width=wrap_content?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
WP7 设备始终具有相同的分辨率,因此您无需担心 DPI。
虽然设备可以具有不同的物理尺寸,但它们不应相差太大。如果您真的很担心,您应该简单地在具有最小和最大物理尺寸的设备上进行设计和测试。
如果您仍然遇到问题,那么可能是由于尝试在屏幕上放置太多内容。如果是这种情况,那么您应该重新设计应用程序。
WP7 的最初设计目标之一是创建一个不会遭受设备碎片化后果(例如屏幕尺寸和分辨率差异巨大)的平台。因此,无需为它们编写代码。
注意 WP7 就是这种情况,但 WP8 支持 3 种分辨率。有关如何支持 WP8 的详细信息,请参阅 http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206974(v=vs.105).aspx
WP7 devices always have the same resolution so you shouldn't need to worry about DPI.
While devices can have different physical sizes they shouldn't differ too much. If you are really concerned you shoudl simply design and test on devices with the smallest and largest physical sizes.
If you still run into issue then it's probably due to trying to put too much on the screen. If that's the case then you should redesign the app.
One of the original design objectives for WP7 was to create a platform which did not suffer the consequences of device fragmentation such as wildly differing screen sizes and resolutions. As such there is no need to have to code for them.
NB This is the case for WP7, however WP8 supports 3 resolutions. For details on how to support WP8 see http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206974(v=vs.105).aspx
不确定这是否回答了您的问题,但是 网格控件通常是最好的方法。
不过,我不知道有什么与 Android 的设备无关像素相当的东西。
Not sure if that answers your question, but the Grid control is usually the best approach when you want to create a layout that adapts to different sizes.
I don't know of an equivalent to Android's device-independent pixels, though.