Xamarin.forms: [Bug] Label LineBreakMode not working

Created on 3 Oct 2019  路  3Comments  路  Source: xamarin/Xamarin.Forms

Description

Label LineBreakMode set to 'WordWrap' isn't working has expected, both for iOS and Android platforms. Words are spaned into multiple lines without hyphenation.

As it can be seen in the following image, the word "communication" is broken;

labelissue labelIssueIos

  • Version with issue: 4.2.0.709249
  • Affected Devices: It seems to be happening accross al iOS devices and on Android from API 21 to API27 (AP28 is ok, it uses hyphenization)

Reproduction Link

Here is a simple repo with a Shell navigation to a page with a single label. Play arround with the label left/right Margin to force the words to be in a break situation and observe the behavior.
LabelIssue.zip

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             x:Class="LabelIssue.Views.LabelPage">
    <ContentPage.Content>
        <StackLayout>
            <Label 
                Margin="20,0"
                VerticalOptions="CenterAndExpand"
                HorizontalOptions="FillAndExpand"
                HorizontalTextAlignment="Center"
                Text="Either聽there聽aren't聽any聽contents聽to聽display聽for聽now聽or聽a聽communication聽error聽occurred."
                LineBreakMode="WordWrap"
                FontSize="Small"
                />
        </StackLayout>
    </ContentPage.Content>
</ContentPage>
Android10 2 help wanted bug up-for-grabs

Most helpful comment

I have same issue on ios. TailTruncation not working.
Xamarin.Forms 4.3.0.991211

All 3 comments

Possibly related
https://github.com/xamarin/Xamarin.Forms/issues/7118

Also HyphenationFrequency on Android Q is set to None by default

I have same issue on ios. TailTruncation not working.
Xamarin.Forms 4.3.0.991211

Same issue here.... label tailtruncation not working on iOS 4.3.0.991211

Was this page helpful?
0 / 5 - 0 ratings