flutter - 在我的一个 SpanText 中应用填充比另一个 spanText 或富文本的填充有什么技巧吗?
问题描述
RichText(
textAlign:TextAlign.center,
text:TextSpan(
children:[
TextSpan(
text:'Create an Account to Continue \n \n',
style:TextStyle(
fontSize:17.0,
fontWeight:FontWeight.bold,
color:Colors.black,
),
),
TextSpan(
text:'By continuing You Agreed to Our ',
style:TextStyle(
fontSize:17.0,
color:Colors.black45,
),
),
TextSpan(
text:'terms of services',
style:TextStyle(
fontSize:17.0,
color:Colors.blue,
),
),
TextSpan(
text:'.',
style:TextStyle(
color:Colors.black,
),
),
],),
),
解决方案
我不这么认为,这不是 TextSpan 小部件的作用,Padding 是图形元素,TextPan 是文本元素。你最好做两个 RichText 并对它们应用填充,你的代码会更清晰。
推荐阅读
- sql - SQL查询获取新重复的行
- autohotkey - 如何找到文件的 MD5 哈希?
- php - 我如何在 gpx 文件中找到第 10 个跟踪点
- angular - Angular + PrimeNg + ChartJs stackblitz 不工作
- reactjs - 拥有一个核心 React 组件来集中通用功能并将其用作所有其他组件的基础是一种不好的做法吗?
- libcloud - 有没有办法在 libcloud 中非递归地列出存储桶中的所有对象
- spring-boot - 春天卡夫卡| 消费者最终在 spring-kafka 中以 CommitFailedException 停止
- c++ - 如何优化这个问题的代码?
- java - Marathon JAVA 驱动程序 - 在从 Eclipse 导出的 JAR 文件中运行时出错
- python - 将 2 个 .xls 文件与 xlrd 和 xlwt 合并