Skip to main content

Fixed: Text and Buttons Cut Off on Narrow Phones in Power Apps

· 9 min read
Jagdish Kumawat
Founder @ Dewiride

On the narrowest phones, 360 pixels wide, my Power Apps app had three layout problems: a title cut in half, a button running off the screen, and list rows where a button left almost no room for the text. Each fix uses the screen's size, so phones get a tighter layout and larger screens stay as they were.

What I Was Doing​

In Part 9 of the Career Development Plan series, I was about to add an Edit button to each row of a list. A button next to the text leaves the text less room, so I first previewed the app at the narrowest phone in Studio's Phones list, the Samsung Galaxy A33 5G, 360 × 800 (How to Test on Phone and Tablet Sizes). Earlier parts had tested phones at 390 × 844.

What I Expected​

The same layout as at 390 pixels: the app's title on one line, the buttons inside the screen and full names in the lists.

What I Got​

The Home screen. The header title wrapped onto two lines, and the header cut both of them. The My team button ran off the right edge:

A 360-wide phone preview of the Home screen with the header title Career Development Plan wrapped and cut at the top and bottom, and the My team button cut off at the right edge

The lists. On My team, each row showed only Olivia and Head of, next to a wide Open button:

A 360-wide phone preview of My team with the row showing Olivia and Head of cut off beside a wide Open button

The button took more of the row than the name did, which raised the obvious question: on a phone, why not drop the button and make the whole row clickable?

Rows of two buttons. Later in Part 9, the new screen's Save and Remove buttons, and its Yes, remove and Cancel buttons, didn't fit side by side. Cancel lost its right edge. The Review screen's Approve and Decline row from Part 8 has the same layout.

What I Checked​

I compared what each control needs with what a 360-pixel screen gives it.

WhereNeedsHas at 360 px
Home title, Career Development Plan at 20 ptMore than one line's width312 px: the header has 24 px of padding on each side
Home buttons, 2 × 160 px with a 16 px gap336 px312 px: the body has 24 px of padding on each side
Two-button rows on the Review and Competency screens336 pxAbout 310 px
My team row text, Parent.TemplateWidth - 208A name on one lineAbout 96 px, because of the 96 px Open button
My plan and waiting-list row text, Parent.TemplateWidth - 144A name on one lineAbout 160 px

Then the question about the whole row. The rows already were clickable: Parts 6 to 8 set each list's Selectable to true and navigate from its OnSelect (How to Open Another Screen When a Gallery Row Is Selected). The button is there because of Microsoft's gallery guidance: when clicking anywhere in an item selects it, keyboard users still need a way to select it, for example a Button whose OnSelect is Select(Parent) (Gallery control: keyboard support). Removing it on phones would leave people with external keyboards or switch access no way to open a row.

Microsoft's Button modern control reference has the middle way: Layout ButtonLayout.IconOnly shows only the icon. That's what I used: a 40-pixel chevron on phones, the full text on larger screens.

Why It Happens​

Fixed sizes that fit at 390 pixels don't fit at 360. Text wraps when its label is too narrow, and a fixed-height label or header cuts off the wrapped line (Fixed: Text Is Cut Off Inside a Container on Small Screens). Buttons with fixed widths don't shrink, so a row of them runs past the container's edge.

The Fix​

Each fix tests the screen's size, App.ActiveScreen.Size = ScreenSize.Small, which is true on phones (Create responsive layouts).

1. Row buttons become a chevron on phones. On every row button, Open in My team and My plan, Review in the waiting list and Edit in the plan list:

PropertyValue
Icon"ChevronRight"
LayoutIf(App.ActiveScreen.Size = ScreenSize.Small, ButtonLayout.IconOnly, ButtonLayout.IconAfter)
WidthIf(App.ActiveScreen.Size = ScreenSize.Small, 40, 96)
Tooltip"Open", "Review" or "Edit"

Each button keeps its AccessibleLabel, such as "Open " & ThisItem.displayName, so screen readers still say what it opens. The row's text then takes the room the button doesn't need, by reading the button's width:

lblCompetencyMPS → Width
Parent.TemplateWidth - btnOpenMPS.Width - 48

The 48 is the text's 16-pixel left margin plus 16 pixels on each side of the button. In My team, the text starts after the avatar, so its formula is Parent.TemplateWidth - btnOpenMTS.Width - 112. How to Show Only the Icon on a Button on Phones explains Layout and Width.

2. Titles are 18 points on phones. On every screen's title label:

lblTitleHS → Size
If(App.ActiveScreen.Size = ScreenSize.Small, 18, 20)

3. Two buttons share the row on phones. On both buttons of each two-button row, on the Home, Review and Competency screens:

btnMyPlanHS → Width
If(App.ActiveScreen.Size = ScreenSize.Small, (Parent.Width - Parent.LayoutGap) / 2, 160)

Parent.Width is the row's container, and Parent.LayoutGap is its Gap, so each button gets half of what's left after the gap.

After the Fix​

The first check didn't look fixed: the Home buttons fit, but the title was still 20 points. I had switched the preview to the phone after opening it on Home. Formulas that only read the screen size didn't run again until I changed screens, while the buttons' width also reads Parent.Width and updated at once. Microsoft's responsive layout article says the authoring canvas doesn't respond to sizing formulas and recommends testing the published app. After going to My team and back, the title fit on one line and both buttons fit:

The same Home screen at 360 pixels after the fix, with Career Development Plan on one line in the header and the My plan and My team buttons side by side inside the screen

The My team row shows the full name and job title, with a chevron button:

The My team row at 360 pixels with Olivia Bennett and Head of Sales in full and a small chevron button on the right

The two-button rows fit inside the screen's margins:

The Edit competency screen at 360 pixels with Save and Remove side by side, the remove question below them, and Yes, remove and Cancel side by side, all inside the margins

Then I published the app and checked the published version in an employee's browser narrowed to 360 × 800. Her My plan rows had the chevron, and Stakeholder management fit on one line:

The published app's My plan screen at 360 pixels wide with four competencies, each with a chevron button, and Stakeholder management on one line

On a tablet or a laptop, the buttons keep their text, now with a chevron after it, such as Open ›.

Common Mistakes​

MistakeWhat happensDo this instead
Removing the row button on phonesKeyboard users can't open a rowKeep the button and show only its icon
Changing Layout without WidthThe icon sits in a wide, empty buttonNarrow the width on phones too
Fixed text widths in a rowThe text doesn't use the space the icon freesSubtract the button's Width in the text's formula
Testing only at 390 pixels360-pixel phones cut text and buttonsCheck the narrowest size in the Phones list

Troubleshooting​

SymptomLikely causeFix
Buttons keep their text in a phone previewThe preview size changed while the screen was openGo to another screen and back, or test the published app
The canvas's Small size still shows text buttonsThe canvas doesn't run sizing formulasUse the preview or the published app
A title still wraps at 18 pointsA long title, such as a long nameKeep header titles short, or lower the phone size further

FAQ​

Isn't the whole row already clickable?​

Yes. Tapping or clicking anywhere in a row opens it, on every screen size. The button is for keyboard users, as Microsoft's gallery guidance asks.

Why 360 pixels?​

It's the narrowest phone in Studio's Phones list. A layout that works there works on the wider phones too.

Conclusion​

Narrow phones need tighter layouts, not different screens. With App.ActiveScreen.Size = ScreenSize.Small, row buttons become a chevron, titles drop to 18 points and paired buttons share their row. The row stays clickable, and keyboard users keep a button.

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.