react-native-svg icon indicating copy to clipboard operation
react-native-svg copied to clipboard

NumberOfLines possible?

Open Sub-Zero-1 opened this issue 3 years ago • 2 comments

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!

Sub-Zero-1 avatar Aug 16 '21 17:08 Sub-Zero-1