javascript - React Native Create Ellipsis Clipped Text in React Native iOS Android or How to make extra text hidden with dots in

<Text style={styles.TextStyle}> This is the Sample Ellipsis Text for Ellipsis from Start.This is

<Text style={styles.TextStyle}> 
  This is the Sample Ellipsis Text for Ellipsis from Start.This is the Sample Ellipsis Text for Ellipsis from Start.This is the Sample Ellipsis Text for Ellipsis from Start.
</Text>

I want to use dots if content exceed more than what I need to display

<Text style={styles.TextStyle}> 
  This is the Sample Ellipsis Text for Ellipsis from Start.This is the Sample Ellipsis Text for Ellipsis from Start.This is the Sample Ellipsis Text for Ellipsis from Start.
</Text>

I want to use dots if content exceed more than what I need to display

Share Improve this question asked Nov 22, 2019 at 6:53 Varunkumar GandeVarunkumar Gande 5996 silver badges18 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

Reference for the answer numberOfLines. just use numberOfLines quantity, if you put numberOfLines = { 2 }, it will display 2 lines and extra text will be in dots.

<Text style={styles.TextStyle} numberOfLines = { 1 } ellipsizeMode = 'head'> 
  This is the Sample Ellipsis Text for Ellipsis from Start.This is the Sample Ellipsis Text for Ellipsis from Start.This is the Sample Ellipsis Text for Ellipsis from Start.
</Text>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745415349a4626723.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信