Skip to main content

Notifications

Community site session details

Community site session details

Session Id : p3RtvdCP/m8P6bV1RJvoj9
Power Apps - Building Power Apps
Answered

App Height Adjustment

Like (0) ShareShare
ReportReport
Posted on 23 Jan 2023 17:11:17 by 4,704 Super User 2025 Season 1

Below is a screenshot of my android displaying a Power App I created.

I've provided the settings for the app. I am unable to determine why the app is not 'filling' the available space, as is desired; Rather, there are large gaps at the top and bottom.

When I use my Surface Pro to view the same Power App (in Portrait) the app fills the available space top to bottom, with a slight black margin on each side. 

I am using a main 'Container' with other containers within. The main contain is set to Parent.Height / Parent.Width.

Phineas_1-1674493156301.png

Phineas_2-1674493197924.pngPhineas_3-1674493237623.png

 

Phineas_4-1674493267688.png

Categories:
  • bobesponja Profile Picture
    252 on 24 Jan 2023 at 14:44:27
    Re: App Height Adjustment

    Based on my understanding, I should be able to hard-code Screen Height/Width 'based' on Orientation, yes?
    > Some kind or If(Screensize.1, Height,1800,2150) - or something close, yes?

    Yes, you can use an If statement if you prefer hardcoded values.

     

    > Where, then, would I begin to install the font formulas? Do they go in each Label or Input font property?

    Yes, after placing the formulas in the Formulas section of your App (click App -> Formulas in the editor), you can reference them in the Size property of text-related controls. If you wanted a control to have a font size of 12 when the ScreenSize is 3 and 10 when the ScreenSize is 2, you can just reference f_FontSizes.s12o10, for example. (If you're anticipating 3 or more ScreenSizes, you can also create additional f_FontSize<number> arrays for those sizes. Just make sure to update the formula for f_FontsSizes when you do)

  • Phineas Profile Picture
    4,704 Super User 2025 Season 1 on 24 Jan 2023 at 14:25:32
    Re: App Height Adjustment

    Great!

    Here is an example -

    I am currently holding my android mobile phone in my hand with the Power App open.

    I've placed the labels on the screen to show Screen Size, Orientation, Height/Width.

    When I hold the phone 'Portrait' those numbers are: 
         Screen Size - 1
         Orientation - Vertical
         Height/Width - 2750 x 1170.

    When I hold the phone 'Portrait' those numbers are: 
         Screen Size - 2
         Orientation - Vertical
         Height/Width - 2750 x 1348

    I hard-coded the height to try and fill the screen regardless of orientation.

    Based on my understanding, I should be able to hard-code Screen Height/Width 'based' on Orientation, yes?

    Some kind or If(Screensize.1, Height,1800,2150) - or something close, yes?

    Where, then, would I begin to install the font formulas? Do they go in each Label or Input font property?

  • bobesponja Profile Picture
    252 on 24 Jan 2023 at 01:29:19
    Re: App Height Adjustment

    Variables and Collections will remain exactly as they are. Named Formulas are a new feature that let you set a new kind of global variable that only gets defined once and doesn't need the Set function to be defined. That way, you don't have to worry about accidentally changing a global variable that you want to leave unchangeable, and you don't need to use Set as often on your app's StartScreen (though you'll still want to keep global/context variables in situations where the values need to change)

  • Phineas Profile Picture
    4,704 Super User 2025 Season 1 on 24 Jan 2023 at 01:15:04
    Re: App Height Adjustment

    The instructions for the toggle setting reads -

    "Use named formulas instead of global variables and collections for faster app load time and logic that is easier to understand and maintain."

    If I'm already using 'Collections' and 'Variables', how will turning on 'Named formulas' impact those settings?

  • bobesponja Profile Picture
    252 on 24 Jan 2023 at 00:31:38
    Re: App Height Adjustment

    No, those would go into Formulas (if you haven't already, you'll have to enable the Named Formulas feature in your project settings). After that, you'll only have to reference f_FontSizes.s20o18 (or whatever font sizes youre needing to choose between) without any If statements. 

     

    (By the way, the font size choices I put in f_FontSize3 and f_FontSize4 were based on my own personal use case. You may have to change things up based on what your app uses. Also, make sure to have it check for App.ActiveScreen.Size = 3 instead of 4 if you're only going to be using this on iPads, since 4 is generally only used when you're on a laptop or something else with a larger screen when your app is built for tablets.)

  • Phineas Profile Picture
    4,704 Super User 2025 Season 1 on 23 Jan 2023 at 23:04:15
    Re: App Height Adjustment

    Does the following go in the App Start?

    f_FontSize4={s20o18: 20, s13o12: 13, s13o11: 13, s12o11: 12, s12o10: 12, s11o10: 11, s11o9p5: 11, s10o9: 10, s9o8: 9}; f_FontSize3={s20o18: 18, s13o12: 12, s13o11: 11, s12o11: 11, s12o10: 10, s11o10: 10, s11o9p5: 9.5, s10o9: 9, s9o8: 8}; f_FontSizes=If(App.ActiveScreen.Size = 4, f_FontSize4, f_FontSize3);

     

  • bobesponja Profile Picture
    252 on 23 Jan 2023 at 19:10:39
    Re: App Height Adjustment

    When using the default Tablet settings, iPads usually get a ScreenSize rating of 3 when horizontal and 2 when portrait. I mainly use the ScreenSize for setting to choose from an array of precalculated font sizes that i use throughout the app:

    //App.Formulas
    f_FontSize4={s20o18: 20, s13o12: 13, s13o11: 13, s12o11: 12, s12o10: 12, s11o10: 11, s11o9p5: 11, s10o9: 10, s9o8: 9};
    f_FontSize3={s20o18: 18, s13o12: 12, s13o11: 11, s12o11: 11, s12o10: 10, s11o10: 10, s11o9p5: 9.5, s10o9: 9, s9o8: 8};
    f_FontSizes=If(App.ActiveScreen.Size = 4, f_FontSize4, f_FontSize3);

     

     

    And then I start going through each control on my app pages and giving it an X/Y/Width/Height formula like

    App.Width * 0.031 //comment containing the default result when viewed in the editor

    However, it may be worthwhile to try only disabling "Lock aspect ratio" so you only have to manage font sizes.

  • Phineas Profile Picture
    4,704 Super User 2025 Season 1 on 23 Jan 2023 at 18:15:25
    Re: App Height Adjustment

    Thank you for the detailed reply.

    How do I do the "the ScreenSize category and app height/width" mathematics for an iPad Pro?

  • Verified answer
    bobesponja Profile Picture
    252 on 23 Jan 2023 at 17:26:50
    Re: App Height Adjustment

    You wwant to have "Scale to fit" and/or "Lock aspect ratio" off, depending on your intentions. Disabling "Lock aspect ratio" will stretch your app to fill the black spaces, but some things might get stretched more than you like. If you disable it and find the effect undesirable, you can also disable "Scale to fit", but this will require you to set mathematical formulas for the x/y/height/width of every control on your page, so you may want to avoid this option. (I manage an app that has "Scale to fit" disabled, so control and font sizes are calculated based on the ScreenSize category and app height/width)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard
Loading started