Maui App: Issues with very large buttons on iPhone

Patrick MacDonald 5 Reputation points
2023-12-06T14:15:27.2866667+00:00

I have a calculator app with buttons. On some iPhones it deploys correctly. On other types of iPhones it deploys with very large buttons that revert to the correct size once I tap a button. Not sure how to get it to deploy correctly all the time.

iPhone 15 - deploys correctly

iPhone 15 Pro Max - deploys with large buttons

iPhone 15 Plus - deploys with large buttons

iPhone 11 - deploys correctly

The iPhone 15 results are from the Simulator while the iPhone 11 result is from the actual device

This all occurs on iOS 17

Developer technologies | .NET | .NET MAUI
{count} votes

1 answer

Sort by: Most helpful
  1. Patrick MacDonald 5 Reputation points
    2023-12-11T15:06:16.0866667+00:00

    After researching and trying a zillion things with no luck, I came up on workaround.

    Pressing a button would cause the buttons to resize correctly. It turns out that I was scaling the button down when pressed and upscaling it when released. That would cause the buttons to resize.

    I did a kludgy workaround by setting a (1/4 second)

    timer in the OnPageAppearing event and then scaling one button when the timer kicked off. This works but is rather kludgy.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.