简体   繁体   English

Windows Phone 8.1维度问题

[英]Windows phone 8.1 dimensions issue

I am having problems understanding the dimensions while developing an App for windows phone. 在开发适用于Windows Phone的应用程序时,我在理解尺寸时遇到问题。

I know there are 3 resolutions: 我知道有3个决议:

WVGA  480 ×  800   15:9
WXGA  768 × 1280   15:9 1.6x scale
720p  720 × 1280   16:9 1.5x scale, 80 pixels taller (53 pixels, after scaling)

The issue is that the Width of the page seems to be always 400 points; 问题是页面的宽度似乎始终为400点。

When i am positioning an item (a Rectangle) in my Page, i set it's Width to 400 . 当我在页面中定位一个项目(一个矩形)时,我将它的Width to 400设置Width to 400 I run the 480x800 emulator (8.1 WVGA 4 inch 512 mb) and the rectangle occupies the whole screen perfectly. 我运行480x800仿真器(8.1 WVGA 4 inch 512 mb) ,矩形完美占据整个屏幕。

But when i try a bigger emulator like the 720p, the rectangle is still occupyng all the width of the page. 但是当我尝试像720p这样的更大的模拟器时,矩形仍然占据了页面的所有宽度。 Shouldn't it occupy 400 px and leave a gap of (720-480)?? 它不应该占据400像素并留下(720-480)的间隙吗?

Why do all the resolutions take 400 to be the fullwidth of the page? 为什么所有分辨率都将400用作页面的整个宽度?

EDIT: I realized that the 400px is different from 480 because the "Device" in Visual Studio says the resolution is 480x800 at 120% scale. EDIT: I意识到400px与480不同,因为Visual Studio中的“设备”表示分辨率为480x800,分辨率为120%。

Why does it use this scale? 为什么使用这种规模? How can i remove this and use the real 480 width points? 如何删除它并使用真正的480宽度点?

EDIT 2: I found the answer to this issue about the 400 px width here EDIT 2:我发现了大约400个像素宽度的答案,这个问题在这里

So my graphic designer was working on a 480x800 canvas for designing the App pages. 因此,我的图形设计师正在480x800画布上设计App页面。 But i had to use a 400x800 canvas instead. 但我不得不使用400x800画布。 So it's very difficult to adapt the designer mock ups to the real App. 因此,很难使设计人员的模型适应真实的应用程序。

What dimensions should the designer usa for the canvas?? 设计师应该为画布设计什么尺寸?

Sounds like you are using Windows Phone 8.1 Universal App project. 听起来像是在使用Windows Phone 8.1 Universal App项目。 Scaling works differently on that platform vs. the old Silverlight platform (which uses the 1.0 / 1.5 / 1.6 system where all devices are considered to be 480 px wide). 扩展在该平台上的工作方式与旧的Silverlight平台(使用1.0 / 1.5 / 1.6系统,其中所有设备被认为是480像素宽)的工作方式不同。

For Universal Apps, the effective resolution depends on the size of the device as well as the physical resolution, so (for the most part) larger phones can show more content. 对于通用应用程序,有效分辨率取决于设备的大小以及物理分辨率,因此(大多数情况下)较大的手机可以显示更多内容。

If you want to fill the screen's width, use HorizontalAlignment=Stretch rather than specifying a width. 如果要填充屏幕的宽度,请使用Horizo​​ntalAlignment = Stretch而不是指定宽度。

In my code its working Fine in emulator 720p please share your Code here. 在我的代码中,它可以在720p仿真器中正常工作,请在此处共享您的代码。 I can not post Image So I cannot share My Screen 我无法发布图片,因此无法共享我的屏幕

My Code is Here 我的代码在这里

  <Grid Background="Green"> <Rectangle Fill="Red" Width="400"/> </Grid> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM