en en en de en en en da da fr da it da da es en da da en da da de da da da sv da en da en en en da pt fr fr de sv da da sv da da en en en en en en en en en en en en en en en en en en en en en en da da da tr da en en en en en en en en en ca en en lt en en en en en en en kn da en en nl nl da en da de de en en nl en en nl nl sv en da de de en en nl en en nl nl sv en da de de en en nl en en sv nl da en da de da en en nl en en nl nl sv en da da da en en nl en en nl nl sv en da da da en en nl en en nl nl sv en da de de en en de da da en en da da en da ms en en en en sv da fr da da en en en zh da de en en en en it en da da en da da da
Craft App Height and Width expressions to create responsive canvas apps | Microsoft Power Apps
Ressourcer til markedslanceringstjenester til partner
Emma Cooper, Senior Program Manager, 18. marts 2019
If you’ve built canvas apps using PowerApps, you’ve noticed that one of te first decisions you need to make is whether you want a layout that is tailored for a phone or for a tablet. This choice will determine te size and shape of te canvas you will work with while building your app.
If your app is used on a device of a different size (or on te web), your entire layout is scaled larger (or smaller) to fit te screen where it is running. If an app designed for a phone is run in a large web browser window, for example, it appears almost comically oversized for its space. It can’t take advantage of all those additional pixels, by showing more controls or more content.
With this new update, experienced app makers can now transform apps into a responsive experience through some work with expressions. You must write formulas that adapt te size and position of controls based on te size of te screen at runtime which is now able to be referenced in te app. You’ll be able to adapt te layout of each of your screens to te actual space in which they are running. As a result, screens show more information with more appropriate font sizes, all making for a better app experience.
Turn off Scale to Fit
As responsiveness is not yet te default for canvas apps, you will need to disable te current default fixed size behavior.
Navigate to App settings > Screen size and orientation, then  turn te Scale to Fit toggle to “Off”.
To learn more about these options, refer to te size and orientation settings in our documentation.
Writing expressions with App Width and Height
Now this announcement is to say that creating responsive apps is possible, unfortunately, not that it is easy. You can now use App.Width and App.Height which return te app’s current width and height. This means you can use expressions to accomplish position and sizing based off of their values.
For a simple example: let’s look at a rectangle that can make a header on an app. When te app grows or shrinks, we want te width of te rectangle to fill te screen, but te height to remain te same.
//Rectangle Header properties Rectangle1.Width = Parent.Width Rectangle1.Height = 88
We can see how te rectangle width is te same as te screen, which takes te full space of te app window.
Some best practices and examples on how to write expressions for different responsive behavior can be found in our documentation on creating responsive layout.
There are still quite a few known limitations that we will be working to lift in te coming while. Most notably:
Moving te controls on te canvas in authoring mode will replace te custom expression to a constant value. It is recommended to select controls using te tree view.
Te responsive sizing cannot yet be seen in te authoring studio. In order to test this functionality, you must Save and Publish your app.
This capability is one small step for PowerApps, one giant leap for te PowerApps community. We are still planning on more investments on providing an experience that allows canvas apps that are responsive by default. Let us know any feedback in te comments below or on te community with te hashtag #ResponsiveLayout
Hvad er Power Apps?
Power Apps er en tjeneste til oprettelse og brug af brugerdefinerede virksomhedsapps, der opretter forbindelse til dine data og fungerer på tværs af nettet og mobil – uden at du skal bruge tid og penge på brugertilpasset softwareudvikling.
Application Lifecycle Management (ALM)
Power Platform Admin Center
Lad os komme i gang
Angiv din arbejds- eller skolekonto for at komme i gang.
Når du tilmelder dig, accepterer du servicebetingelserne.
Erklæring om beskyttelse af personlige oplysninger
Beskyttelse af personlige oplysninger og cookies
čeština dansk Deutsch (Österreich) Deutsch (Schweiz) Deutsch (Deutschland) Eλλnvιkά English (Australia) English (Canada) English (Cyprus) English (UK) English (Ireland) English (India) English (Malaysia) English (New Zealand) English (Singapore) English (US) English (South Africa) español (España) español (México) français (Belgique) français (Canada) français (Suisse) français (France) suomi magyar italiano (Svizzera) italiano (Italia) 日本語 한국어 norsk bokmål Nederlands (België) Nederlands (Nederland) polski português (Brasil) português (Portugal) pycckий svenska ไทย Türkçe 中文(简体) 中文(繁體) العربية עברית