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 can I middle align...
Power Apps
Unanswered

How can I middle align an object in a gallery by setting the Y axis?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have an image object in a gallery and want it to always be middle aligned within the gallery template. How can I configure the Y axis? I have tried taking the Parent.TemplateHeight/2, but that does not even remotely set the setting where it needs to be.

Categories:
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    What happens when you use that expression?

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://thepoweraddict.com
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The Y position ends up really far down in the gallery outside of the template height. The Template Height is 85, so TemplateHeight/2 is 42.5, which places the image really far down outside of the template perimeter.

  • WillPage Profile Picture
    2,339 Super User 2026 Season 1 on at

    You need to take half the height of the image off the midpoint of the template, so it should be like (TemplateHeight /2) - (image.Height /2)

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    If you want to middle align an image object in a gallery via the Y axis, please take a try with the following workaround:

    7.JPG

    Set the Y property of the Image control within the Gallery to following:

    (Parent.TemplateHeight / 2) - (Image2.Height / 2)

     

    Please consider take a try with above solution, check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That did it. I appreciate your help.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard