8000 Add maxLines Property to Label · Issue #8485 · NativeScript/NativeScript · GitHub
[go: up one dir, main page]

Skip to content
Add maxLines Property to Label #8485
Open
@wendt88

Description

@wendt88

Is your feature request related to a problem? Please describe.
It would be nice to add maxLines property to the Label view. It could be done with a angular/vue directive, but it's always buggy, especially inside a ListView

Describe the solution you'd like

if (view.android) {
        view.android.setSingleLine(false);
        view.android.setMaxLines(maxLines);
        view.android.setEllipsize(android.text.TextUtils.TruncateAt.END);
}
else if (view.ios) {
        viewl.ios.numberOfLines = maxLines;
        view.ios.adjustsFontSizeToFitWidth = false;
        view.ios.lineBreakMode = NSLineBreakMode.ByTruncatingTail;
}

Additional context
Inside a ListView the View gets initialized without native element. so the properties above must be set later. And that does not updates the View.

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

      0