xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.87k forks source link

[Bug][Android] LineBreakMode "NoWrap" behaves like "WordWrap" #9797

Open Huaba93 opened 4 years ago

Huaba93 commented 4 years ago

Description

Setting LineBreakMode to NoWrap Behaves differently on Android than on iOS. For Android it behaves like WordWrap (single line), on iOS it is as expected.

Steps to Reproduce

  1. Create Label with long words (this is where the problem is most visible)
  2. Deploy to an Android device

Expected Behavior

image

Actual Behavior

image

Basic Information

Version with issue: Xamarin.Forms 4.4.0.991640 Last known good version: - IDE: Visual Studio Community 2019 for Mac (Version 8.4.3 (build 12)) Platform Target Frameworks: iOS: working for iOS Android: 5.0+

Reproduction

<Label Text="ALongWordThatIsReallyLong ALongWordThatIsReallyLong ALongWordThatIsReallyLong" LineBreakMode="WordWrap" VerticalOptions="CenterAndExpand" />

Workaround

Replace spaces with the unicode no-break space character (U+00A0).

myString.replace(" ", "\u00A0");

Huaba93 commented 4 years ago

I guess related to #7118

hartez commented 4 years ago

_9797 Repro.zip

Huaba93 commented 4 years ago

fyi: the workaround leads to wrong linebreaks on iOS

without workaround

alt text

with workaround

alt text
Huaba93 commented 3 years ago

Issue opened for more than one year...anything new to this?