'Issue with <Text> truncation when there is a new line character in the string react-native ios
I have an issue. Please find the text display code I use inside a view
<Text numberOfLines={5} ellipsizeMode={"tail"}>
{getDisplaySrting()}
</Text>
This piece of code is working fine in iOS and Android in the case of normal strings which span for more than 5 lines. The fifth line will end with the expected 3 dots in the view.
eg: This is the fifth li...
However I face an issue when there is a line break in the string, and if it is lying in the fifth line.
For eg: In the fifth line if the string was This is the fifth\n line
Then in Android the fifth line will be displayed as This is the fifth...
However in iOS this is shown as: This is the fifth No ellipses are shown at the end.
So it gives a feel that the strig ends at fifth in the case of ios.
I assume this is a limitation in iOS. Has anyone faced this issue? Also any workarounds or recommendations here?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
