admin管理员组

文章数量:1425655

<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>

本文标签: