flutter richText富文本
flutter中富文本使用
RichText(
text: TextSpan(
text: '登陆即同意',
style: TextStyle(fontSize: 14, color: Colors.black),
children: [
TextSpan(
text: '"服务条款"',
style: TextStyle(fontSize: 14, color: Colors.blue),
recognizer: TapGestureRecognizer()
..onTap = () {
print('点击了服务条款');
},
),
TextSpan(
text: '和',
style: TextStyle(fontSize: 14, color: Colors.black),
),
TextSpan(
text: '"隐私政策"',
style: TextStyle(fontSize: 14, color: Colors.blue),
recognizer: TapGestureRecognizer()
..onTap = () {
print('点击了隐私政策');
},
),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Image.asset(
'assets/noavatar.png',
width: 20,
height: 20,
),
),
],
),
),
TextSpan可以用来显示文字类型,设置文字颜色,点击事件等
TextSpan(
text: '"隐私政策"',
style: TextStyle(fontSize: 14, color: Colors.blue),
recognizer: TapGestureRecognizer()
..onTap = () {
print('点击了隐私政策');
},
),
WidgetSpan 可以用来显示任意widget,图片按钮等等
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Image.asset(
'assets/noavatar.png',
width: 20,
height: 20,
),
),
flutter richText富文本的更多相关文章
- 支付宝小程序开发——rich-text富文本组件支持html代码
前言: 与微信小程序不同,支付宝小程序的富文本组件并不能直接支持html代码,如: 如上,支付宝小程序的富文本组件只支持数组类型,html代码需要使用 mini-html-parser 转换,具体用法 ...
- RichText 富文本开源项目总结
在Android开发中,我们不免会遇到富文本的编辑和展示的需求,以下是本人之前star的富文本编辑器的开源项目,供大家参考: 一.RichEditor 开源项目地址:https://github.co ...
- 2.15 富文本(richtext)
2.15 富文本(richtext) 前言 富文本编辑框是做web自动化最常见的场景,有很多小伙伴不知从何下手,本篇以博客园的编辑器为例,解决如何定位富文本,输入文本内容一.加载配置 1 ...
- cocos2dx --- 富文本的使用 RichText
在实际工作中,有非常多地方会使用 富文本,这里仅仅介绍最简单的富文本用法: 是由cocostudio 提供的 RichText: 直接贴代码,再分析: //这里測试富文本控件 ui::RichText ...
- 【rich-text】 富文本组件说明
[rich-text] 富文本组件可以显示HTML代码样式. 1)支持事件:tap.touchstart.touchmove.touchcancel.touchend和longtap 2)信任的HTM ...
- swift---不同字体大小不同颜色label富文本设置
agreeDeal = UILabel() //富文本,不同字体颜色大小和颜色 let labelString = "登录注册,表示您同意<服务条款及隐私政策>"as ...
- 【WP8.1】富文本
之前写过一篇WP8下的富文本的文章,但是写的不是很好,整理了一下,分享一下WP8.1下的富文本处理 富文本处理主要是对表情和链接的处理,一般使用RichTextBlock进行呈现 问题说明: 由于Ri ...
- WP&Win10开发: RichTextBlock实现富文本并处理换行
思路:1.构建字典.2.在字符串中匹配字典的key,将匹配到的key转换成对应的value3.将替换后的字符串,转化成xaml形式,加载该xaml以实现富文本. 代码如下: private Parag ...
- cocos2d-x中,简单html富文本显示
作者:HU 转载请注明,原文链接:http://www.cnblogs.com/xioapingguo/p/4037414.html 虽然自从cocos2d-x更新到3.0后,使用freetype, ...
随机推荐
- mysql启动失败,unit not found
1 mysql启动 Failed to start mysqld.service: Unit not found. 2 查询/etc/init.d/下是否存在mysqld ll /etc/init ...
- HLS manifest standard 翻译: HTTP Live Streaming draft-pantos-http-live-streaming-23
我为什么要干这种事 Introduction to HTTP Live Streaming 1 OVerview Multimedia presentation : specified by a Un ...
- mysql——数据库存储引擎
MyISAM INNODB myISAM.innodb.memory MyISAM对事务要求不高,以查询和添加为主,考虑使用. 如bbs中的发帖表,回复表: INNODB存储引擎 对事务要求高,保存的 ...
- python+selenium之——错误:selenium.common.exceptions.WebDriverException: Message: ‘geckodriver’ executable needs to be in PATH.
此时,需要自己配置geckodriver 下载geckodriver,地址:https://github.com/mozilla/geckodriver/releases 下载后解压得到geckodr ...
- D. Connected Components Croc Champ 2013 - Round 1 (并查集+技巧)
292D - Connected Components D. Connected Components time limit per test 2 seconds memory limit per t ...
- Educational Codeforces Round 40 C. Matrix Walk( 思维)
Educational Codeforces Round 40 (Rated for Div. 2) C. Matrix Walk time limit per test 1 second memor ...
- [2019牛客多校第二场][A. Eddy Walker]
题目链接:https://ac.nowcoder.com/acm/contest/882/A 题目大意:圆上有\(n\)个点,标号从\(0\)到\(n-1\),初始一个人在点\(0\),每次会等概率向 ...
- 内置对象:Math
JavaScript内置函数Math.random()自定义封装函数:1,Math.floor(Math.random()*(b-a+1)+a) 随机生成a到b之间的整数. 也可以写成:Math.f ...
- linux 下python进程查看及关闭
查看进程 ps -ef |grep python 关闭进程 kill -9 26879 其中26879为进程号. linux下后台执行某个python脚本 nohup python -u xxx.py ...
- RestTemplate发送GET请求
import org.springframework.web.client.RestTemplate; @Component @Slf4j public class JsSdkUtil { /** * ...