您可以使用 numberOfLines 作为 <Text /> 组件的道具。它取决于组件的宽度,然后计算文本的长度。这个道具通常与 ellipsizeMode 一起使用。例子: <Text numberOfLines={2} ellipsizeMode='tail'> Lorem Ipsum is simply dummy text of the printing and typesetting industry. </Text> 原文由 namth 发布,翻译遵循 CC BY-SA 4.0 许可协议
您可以使用
numberOfLines
作为<Text />
组件的道具。它取决于组件的宽度,然后计算文本的长度。这个道具通常与ellipsizeMode
一起使用。例子: