Windows Phone的比例因子/正确设计 [英] Scale factor/correct design for Windows Phone
问题描述
如何对Windows Phone中的所有分辨率进行正确的设计测量?
按照Microsoft
文章基本屏幕大小为800x400(853x400),但在现实生活中看起来并不真实。
我以基本分辨率853x400进行设计
代码
How to make correct design measurements for all resolutions in windows phone?
As per Microsoft
article base screen size is 800x400 (853x400) but in real life it doesnt looks like true.
I did design in base resolution 853x400
Code
<Image Width="160" Height="90" Source="{Binding ImageURL}"/>
我希望在不同的仿真器上看到的是
- WVGA 4英寸 - x1 = 160x90
- 720p 4.7英寸 - x1.5 = 240x135
- 1080p 5.5英寸 - x2.25 = 360x203
$
我看到的是什么?
- WVGA 4英寸 - x1.2 = 192x108
- 720p 4.7英寸 - x1.8 = 288x162
- 1080p 5.5英寸 - x2.4 = 384x216
测试保证金时 - 我得到的结果大致相同:
代码
What I expect to see on different emulators
- WVGA 4 inch - x1 = 160x90
- 720p 4.7 inch - x1.5 = 240x135
- 1080p 5.5 inch - x2.25 = 360x203
What I see
- WVGA 4 inch - x1.2 = 192x108
- 720p 4.7 inch - x1.8 = 288x162
- 1080p 5.5 inch - x2.4 = 384x216
When testing margins - I got more or less same results:
Code
<Grid Margin="14, 0, 0, 0"/>
- WVGA 4英寸 - x1.214 = 17px
- 720p 4.7英寸 - x1.79 = 25px
- 1080p 5.5英寸 - x2.43 = 34px
但字体图纸不同
代码
- WVGA 4 inch - x1.214 = 17px
- 720p 4.7 inch - x1.79 = 25px
- 1080p 5.5 inch - x2.43 = 34px
But fonts drawing is different
Code
<Style x:Key="TitleStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="28" />
<Setter Property="FontWeight" Value="SemiLight" />
<Setter Property="VerticalAlignment" Value="Center">
</Style>
结果
- WVGA 4英寸 - x0.93 = 26px
  ; - 720p 4.7英寸 - x1.32 = 37px
- 1080p 5.5英寸 - x1.75 = 49px
我已检查 DisplayInformation.GetForCurrentView()。RawPixelsPerViewPixel
看起来乘数不取决于分辨率而是取决于ppi!我该做什么?如何正确使用不同的分辨率?主要问题 - 应该进行分辨率设计测量(哪个res
最低)以及我可以期望在不同分辨率的屏幕上看到的,如何测试设计?
推荐答案
我们可以尝试创建一个动态布局:
http ://msdn.microsoft.com/en-us/library/windows/apps/jj207042(v = vs.105).aspx#BKMK_DynamicLayout 。
这篇关于Windows Phone的比例因子/正确设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!