obu*_*oon 3 reactjs react-native
我如何只显示第一行文字?如果我有这样的事情:
<View>
<Text>
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words,
</Text>
</View>
Run Code Online (Sandbox Code Playgroud)
我只想显示“与流行的看法相反,洛雷姆·伊普森”。
您可以使用道具numberOfLines来限制文本的溢出:
<Text numberOfLines={1}>
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words,
</Text>
Run Code Online (Sandbox Code Playgroud)
当达到父视图的限制时,这将包装您的文本,例如:
Contrary to popular belief, Lorem Ipsum is not...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
712 次 |
| 最近记录: |