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

[Bug] Label MaxLines property has a different behaviour on Android and iOS #11427

@cliffconclusion

Description

@cliffconclusion

Description

When a label is set to MaxLines 0, on iOS it will show maximum available lines, on Android it shows literally 0 lines. I would expect the iOS behaviour.

Our situation:
We have a label which is set to 2 lines maximum when we load the screen. When the user presses the label it is supposed to extend and show the full text. We tried doing this by setting MaxLines to 0. this works on iOS, but does not work on Android.

Steps to Reproduce

  1. Create a Label.
  2. Put in a text with multiple lines.
  3. Set MaxLines to 0.

Expected Behavior

Setting the MaxLines to 0 shows all the lines available. (if I would want to show 0 lines, I could just set the IsVisible to false)

Actual Behavior

On iOS => Expected behaviour.
On Android => The label literally shows 0 lines.

Basic Information

  • Version with issue: Xamarin.Forms 4.7.0.1080
  • Last known good version: -
  • IDE: Visual Studio For Mac 8.6.5 (build 23)
  • Platform Target Frameworks:
    • iOS: iOS 11
    • Android: Android 9.0
  • Nuget Packages: Xamarin Essentials, Xamarin Forms
  • Affected Devices: As far as we know all of them.

Workaround

We currently work around it by setting the MaxLines to a ridiculously high number. Which will make sure in every case it shows the maximum lines available.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions