web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do I make my home ...
Power Apps
Answered

How do I make my home screen responsive where the button along with the text inside response to parent width?

(0) ShareShare
ReportReport
Posted on by 77

Hi, 

 

I have an app with a header and four buttons on the home screen. Everything is fine on the canvas scale, however, when I reduce the screen size. the text in the buttons and the buttons themselves don't resize. 

 

Currently the page utilises the header and footer template. 

 

Thank you in advance for your help. 

 

Screenshot 2023-10-04 at 17.18.18.png

Categories:
  • Verified answer
    Chris-D Profile Picture
    1,246 on at

    I calculate font sizes on app start and create a UI object. Here's a code snippet based on what I'm doing.

     

     

     

    Set( UI, 
     With({
     // Ratios
     Landscape: App.Width > App.Height,
    
     // Calculate the ratio between the app display size and the size it was designed in
     WidthRatio: App.Width / App.DesignWidth, 
     HeightRatio: App.Height / App.DesignHeight
     },
     With({
     // Base sizes
     // 28 and 34 are my 'default' sizes, all other sizes are based on these
     // Scale based on the height ratio calculated above
     BaseFontSize: If( Landscape, 28, 34) *HeightRatio,
     },
     {
     Fonts: {
     HeadingSize: BaseFontSize,
     TextSize: BaseFontSize /2
     }
     }
     )
     )
    )

     

     

     

    On your text labels, buttons etc, you can then use UI.Fonts.HeadingSize etc.

     

     

  • lmcc Profile Picture
    77 on at

    @Chris-D @Thank you. This works, but I would like to learn more. Where do I head to find out where you learned this? I would like to apply the same principles to button size, too

  • Chris-D Profile Picture
    1,246 on at

    I learned it though years of experience. Documentation can tell you how things work but only experience and ingenuity can tell you how to put those functions together. 

     

    You can use the same method for button size too though. Just create some other variable inside the object and give it a size adjusted with HeightRatio, in the same way the font size is calculated. 

  • lmcc Profile Picture
    77 on at

    @Chris-D @Thank you. That’s fair enough. What kind of ratio do you suggest for buttons? Or a better question might be, how do you determine the ratio per component / property? 

  • Chris-D Profile Picture
    1,246 on at

    So the ratio is worked out for you:

    App.Height / App.DesignHeight

    This gives you the ratio between the height of the design (the canvas editor) and the height of the user's app. 

     

    If in your design your button is 50 high, you'd create a variable called (for example)

    ButtonHeight: 50 *HeightRatio

     

    Imagine that your design height is 1136 (the default height for mobile app) but your user is using an iPhone 14 in portrait orientation which has a height of 2532. That's quite a lot bigger so your buttons would appear very small. 

     

    The ratio would be 2532 / 1136 = 2.23

    So your button height would be 50 *2.23 = 111.5

     

    So your button is now scaled up to be just over twice as high, so it appears the same size on screen. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard