作者热门文章
- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
如何更改部分文本的颜色?我正在努力使文本显示“没有帐户?立即注册!
”,但我想为 立即注册!
部分添加颜色。如果可能,我该怎么做?
最佳答案
使用 RichText
https://docs.flutter.io/flutter/widgets/RichText-class.html
RichText(
text: TextSpan(
text: "Don't have an account? ",
style: TextStyle(color: Colors.black, fontSize: 40),
children: <TextSpan>[
TextSpan(text: ' Register now!', style: TextStyle(color: Colors.red)),
],
),
);
关于flutter - 如何在 Flutter 中将颜色作为 UI 文本的一部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55778185/
我是一名优秀的程序员,十分优秀!