我想限制行数并在 flutter 中渲染 html 标签,现在我正在使用文本小部件并限制行数。问题是我在其余的完整 api 中获取 html 标签,所以我想渲染这些标签。我尝试了 flutter html 包,但没有限制行数的选项。谢谢
Container(
padding: EdgeInsets.symmetric(horizontal:10.0),
margin: EdgeInsets.only(bottom:10.0),
child: Text(
widget.description,
style:plpDescriptionTextstyle,
maxLines: 4,
),
),
Run Code Online (Sandbox Code Playgroud)
小智 11
您可以使用此库中的样式:
Html(
data: 'Your text with html tag',
style: {
'#': Style(
fontSize: FontSize(18),
maxLines: 10,
textOverflow: TextOverflow.ellipsis,
),
},
),
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9604 次 |
| 最近记录: |