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 / Container width is dif...
Power Apps
Answered

Container width is different in play mode

(0) ShareShare
ReportReport
Posted on by 373

When I am editing the app all of the borders align, however when I play there a large gap. I try every width setting but nothing changes. Is this how containers work? my first time trying to use one.

 

Edit mode

leslie_rivera_0-1712079530907.png

 

Play mode

leslie_rivera_1-1712079544348.png

 

Categories:
  • renatopc84_ch Profile Picture
    228 on at

    Hi @leslie_rivera 

    How did you configured the width parameter? The edit view use a fix resolution. In play mode get the width from the APP Width parameter that is usually variable.

    To be sure the Width of the Container should be: Parent.Width - Self.X

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @leslie_rivera,

     

    The container seems to use the available space, however the gallery does not. Would it be possible to (1) Select the gallery control, (2) go to the property panel on the right side and (3) set the Align in Container property to 'Stretch'

     

    LaurensM_0-1712080301252.png

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • leslie_rivera Profile Picture
    373 on at

    I updated the gallery control to stretch. Seems to work but there is still a lot of dead space.

    leslie_rivera_0-1712088447348.png

     

    leslie_rivera_2-1712089408053.png

     

     

    Container Width: Parent.Width - Self.x

     

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @leslie_rivera,

     

    Thanks for the extra info! 😊

    The gallery now occupies all available space, but the controls within your gallery have hardcoded X values. When designing responsive Power Apps, you will have to provide dynamic X (Y, Width & Height) values and/or use horizontal / vertical containers - otherwise the control position will remain static regardless of your screen size.

     

    Depending on the requirements (e.g. both mobile & desktop), responsive design can seem rather complex at first sight. I will provide a short overview below, but I would highly recommend watching some tutorials on YouTube or blog posts on responsive design. (e.g. Reza, Shane, Matthew...)

     

    As an example: Should you want the arrow icon on the right-hand side, you could use the X property below.

    //15 is used as an example margin
    Parent.TemplateWidth - Self.Width - 15

     

    The X property of the Edit icon could be:

    //15 is used as a margin between both icons
    //Change ViewIcon to the correct icon name
    ViewIcon.X - Self.Width - 15

     

    An example of a dynamic Width value would be the separator shape control:

    //Instead of a hardcoded value in the Width property, use:
    Parent.TemplateWidth


    As a note: Should you want to create an app that remains the size of the Canvas (not responsive), you could enable 'Scale to fit' & 'Lock aspect ratio' in the app settings:

    LaurensM_0-1712090929217.png

    This would allow you to hardcode X, Y, Width and Height values. Please note that this would result in a fixed app screen size, which will not use all of the available screen height & width on a desktop screen nor be responsive on smaller devices.

     

    I hope this helps!

  • leslie_rivera Profile Picture
    373 on at

    Thanks! I think I will stick with scale and lock for now. I need more time than I have to work out the responsive design.

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard