Xamarin.forms: Flex Layout not wrapped text correctly for Label

Created on 19 Feb 2019  路  4Comments  路  Source: xamarin/Xamarin.Forms

Description

The Label text was not shown fully in Flex Layout. The only first part of the text was shown. Check the attached screenshot for more details.

Steps to Reproduce

Code :

<FlexLayout
                        HorizontalOptions="Start" 
                        VerticalOptions="Center" 
                        Direction="Row" 
                        Wrap="Wrap"
                        JustifyContent="Start"
                        AlignContent="Start" 
                        AlignItems="Start">
                <Label Margin="8,0,8,0" Text="Elvis A. Presley" LineBreakMode="NoWrap"/>
                <Label Margin="8,0,8,0" Text="John Doee" LineBreakMode="NoWrap"/>
                <Label Margin="8,0,8,0" Text="Ryan Gig" LineBreakMode="NoWrap"/>
                <Label Margin="8,0,8,0" Text="Rathana Kumar" LineBreakMode="NoWrap"/>
                </FlexLayout>
  1. Run the above code
  2. The Label text was not shown fully

Expected Behavior

Need to display the full text in the Label

Actual Behavior

Only the first part of the Label text only shown

Basic Information

  • Version with issue: 7.1
  • Last known good version: -
  • IDE: VS 17 Mac
  • Platform Target Frameworks:

    • iOS: -

    • Android: 7.1

    • UWP: -

  • Android Support Library Version:
  • Nuget Packages: -
  • Affected Devices: Currently checked in Moto G5 Plus.

Screenshots

image

Reproduction Link

Use the below code

<FlexLayout 
                        HorizontalOptions="Start" 
                        VerticalOptions="Center" 
                        Direction="Row" 
                        Wrap="Wrap"
                        JustifyContent="Start"
                        AlignContent="Start" 
                        AlignItems="Start">
                <Label Margin="8,0,8,0" Text="Elvis A. Presley" LineBreakMode="NoWrap"/>
                <Label Margin="8,0,8,0" Text="John Doee" LineBreakMode="NoWrap"/>
                <Label Margin="8,0,8,0" Text="Ryan Gig" LineBreakMode="NoWrap"/>
                <Label Margin="8,0,8,0" Text="Rathana Kumar" LineBreakMode="NoWrap"/>
                </FlexLayout>
flex 4 help wanted inactive Android bug up-for-grabs

All 4 comments

I placed that bit of XAML into a Shell template app and the full names display. Do you experience this on all devices, or only specific ones such as the one mentioned? Which version of Forms are you using?

Yes, this issue occurs in all the devices and the devices which we checked are MOTO G4, Samsung S8 and MOTO G5 devices. We used the latest Xamarin forms version 3.5.0.169047.

I have checked with other devices if we adjust the Margin values the same issue came in Lenovo K4, Moto G4, Moto E2 devices.

Workaround - replace Labels with Buttons. Nasty, but fixes the issue for me.

Was this page helpful?
0 / 5 - 0 ratings