Skip to content

NumberOfLines possible? #1631

Open
Open
@Sub-Zero-1

Description

@Sub-Zero-1

Question

Hi!

I have a long text:
const myLongText = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";

I break the line with like:

<Text fill="#000000" fontFamily={...} fontWeight="600">
   <Tspan x="112" y="120" inlineSize={100}>
   {myLongtext}
  </Tspan>
</Text>

How can I reduce the number of line to two? The longer the text the more number of lines I get, but I can not allow more than two lines and then the text needs to be truncated like "XYZ..."

Is there a easy way of doing so? With the text component from native-base or react-native I just can do:
<Text numberOfLines={2} ellipsizeMode='tail'>{myLongText}<Text>

Thanks in advance!

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