經(jīng)常在繪畫UI的時候遇到這種問題,依據(jù)場景不同,說下我自己的常用方案:
1. 第一種就是給Text標簽外層嵌套一層Container,并指定width寬度文章來源:http://www.zghlxwxcb.cn/news/detail-554514.html
2.第二種是自動適配模式,我常用于Text外層嵌套了Row和Column以及一些布局控件中文章來源地址http://www.zghlxwxcb.cn/news/detail-554514.html
new?Flexible(?//長度自適應(yīng)
??child:?new?Container(
????padding:?new?EdgeInsets.only(right:?13.0),
????child:?new?Text(
??????'Text?largeeeeeeeeeeeeeeeeeeeeeee',
??????overflow:?TextOverflow.ellipsis,?//長度溢出后顯示省略號
??????style:?new?TextStyle(
????????fontSize:?13.0,
????????fontFamily:?'Roboto',
????????color:?new?Color(0xFF212121),
????????fontWeight:?FontWeight.bold,
??????),
????),
??),
),
到了這里,關(guān)于flutter中文字長度溢出時如何顯示省略號?的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!