Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Label with padding cuts text in specific cases on iOS #10077

Open
domenk opened this issue Mar 24, 2020 · 11 comments
Open

[Bug] Label with padding cuts text in specific cases on iOS #10077

domenk opened this issue Mar 24, 2020 · 11 comments

Comments

@domenk
Copy link

domenk commented Mar 24, 2020

Description

In certain cases Label on iOS may cut last line of text. This happens if padding is applied to the Label and the text would otherwise fit into the view if the Label was the same width but without the padding.

Issue occurs on iOS. Android is fine.

Steps to Reproduce

Run the attached project: FormsBug.zip

See the screenshot below (iPhone 11 iOS 13.3, two screenshots merged).

Sections on the screenshot:

  • First three sections show example text, with orange Labels not showing the whole text.
  • Green section shows Labels with progressively larger padding. First three Labels have right margin set to 54, and last three to 53 (just enough to not cause line break). It shows that if first Label (which is without horizontal padding) wraps text (and therefore increases view height), Labels with horizontal padding will also increase their height. But if Label without horizontal padding does not wrap the text (first of the last three Labels), Labels with padding won't increase their height to account for the new line.
  • Grey section: text is not shown even if Label has pre-set larger height.

Issue also appears on iPhone 8 iOS 13.3 and iPhone 7 iOS 10.3, but not on the same labels.

iPhone 11 iOS 13 3

Expected Behavior

Whole text should be shown.

Actual Behavior

In certain cases part of the text is not shown.

Basic Information

  • Version with issue: 4.5.0.396
  • Last known good version: /
  • IDE: Visual Studio 2019 16.5.0
  • Platform Target Frameworks:
    • iOS: 13.14.1.39
    • Android: 10.2.0.100
  • Affected Devices: iPhone 11 iOS 13.3, iPhone 8 iOS 13.3, iPhone 7 iOS 10.3

Workaround

Do not use padding.

@domenk domenk added s/unverified New report that has yet to be verified t/bug 🐛 labels Mar 24, 2020
@PureWeen
Copy link
Contributor

Hmmmm I tried running your sample but I'm not seeing what you're seeing. Below is iPhone 7 10.3.1. I tried iPhone8 and 11 with 13.3 and I'm not seeing the issue

image

@PureWeen PureWeen added s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Mar 27, 2020
@domenk
Copy link
Author

domenk commented Mar 27, 2020

Your screenshot also contains problematic labels: all "Lorem ipsum" labels except the middle one are missing words "adipiscing elit" at the end.

@PureWeen PureWeen added a/layout p/iOS 🍎 and removed s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified labels Mar 28, 2020
@PureWeen
Copy link
Contributor

@andreinitescu FYI

@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@stevewinn74
Copy link

stevewinn74 commented Aug 27, 2020

This has been driving me mad. For me it only happened on iOS with dynamically set text (Binding or assigned in code).

Removing the padding from the label was a good workaround. Putting the padding on the parent element instead was no problem.

@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@reparaturo
Copy link

Today, 25.02.2021 the issue still persist. Will this eventually get resolved? No padding is not an option in many cases due to readability. (VS 2019 16.8.5 all up to date).

@xleon
Copy link

xleon commented Mar 11, 2021

I spent about 3 hours today with this issue until I found out myself about the padding thing.
In my case it only happens with low resolution devices. Specifically on iPhone SE 1st generation simulator.
@PureWeen please try with that simulator.

My workaround was to wrap the label in <ContentView Padding="[padding]">

@AlleSchonWeg
Copy link
Contributor

This could be the same problem: #12710

@no8fear
Copy link

no8fear commented Aug 20, 2021

Still an issue as of 20/08/2021 with Xamarin Forms on latest version and VS 2019 On latest version, any update on when this will be fixed?

@somoreingold
Copy link

Is there a way to bring more votes or attention to this issue?

@rezamohamed
Copy link

Same issues!

@JordiCasas
Copy link

Another workaround that works in most cases is to use the Margin property instead of the Padding.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests