cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Pappi
Level: Power Up

Screen.Width is always 640

Hi Guys,

 

I made an application with screen aspect ratio lock turned off. (https://powerapps.microsoft.com/hu-hu/tutorials/set-aspect-ratio-portrait-landscape/)

 

I tried to make a header image with the screen width and calculate the height, based on image original aspect ratio.

Image1.Width = Screen1.Width

Image1.Height = Round(Image1.Width * (Image1.OriginalHeight/Image1.OriginalWidth); 0)

Image1.CalculateOriginalDimensions = true

Image1.ImagePosition = ImagePosition.Fit

 

The image width is ok, it is as wide as the screen.

But, the Screen1.Width is always equal to 640, so the calculated height is always the same value.

 

If i put the Screen1.Width and Screen1.Height into textbox, it displays 640x1136 always (9:16). I have an Nexus5 phone, screen size: 1080x1776 (9.7:16).

 

Could someone help me?

 

Imre

3 REPLIES 3
Community Support Team
Community Support Team

Re: Screen.Width is always 640

Hi Imre,

 

The default phone size for PowerApps is 640x1136. From the article you has provided, we know that If we unlock the aspect ratio, the app will adjust to the aspect ratio of the device on which it's running.

 

On your Nexus5 phone how is the image displayed? Could you show me a screenshot?

 

As I don’t have a Nexus5 phone, I test this issue on my iPhone6. I create the App on PowerApps studio according to your description, then I open it on my phone. The Screen1.Width and Screen1.Height value shown in the Textbox is the default size.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Pappi
Level: Power Up

Re: Screen.Width is always 640 and Screen.Height is always 1136

Hi,

 

here is the screenshot from my phone.

 

https://drive.google.com/open?id=0B2lxCcXD347yM2xyZG9tRVNRR1k

 

my header image is the green box bordered with black line, the red color is the background of the image

my expectation is: no red color is visible,

 

if the width is 640 the height must be 1054 (becaue of aspect ratio of Nexus5)

 

1136/1054 * 200 = 215.56

So i tried to set 215.56 as height for image, and the result was i expected, no visible red background on Nexus5 (ofc the red background appeared on 9:16 screen now)

 

so i think if i set 200, it is realy recalculated to 185.56, 215.56 recalculated to 200, which is the good height for image if the width is 640. This recalculating based on default screen height and the real height aspect ratio, and the screen width normaized to 640. 

 

It would be good for me, if i know the aspect ratio of the current screen. 

So, the topic name should change to "the Screen.Height is always 1136"

 

 

 

 

Community Support Team
Community Support Team

Re: Screen.Width is always 640 and Screen.Height is always 1136

Hi Pappi,

 

Thanks for your reply. It seems that this issue has been solved.

 

If you have any other issues when using PowerApps, please feel free submit on this forum.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 300 members 3,128 guests
Please welcome our newest community members: