使用styledstring给text组件显示时,显示内容为空
可以确定的是传值按照文档里面的示例做的
trycatch也没有报错
我的styledString的构建是没有问题的,自己在demo里面尝试可以显示。
但是写在list的item里面就无法显示。。。
在list的item中
1,new一个textController,外部传styledString进item里面来,在aboutToAppear里面setStyledString====\>空白内容
2,外部传一个textController,在list的build函数里面根据这个controller来构建一个Text=====\>还是空白内容
setStyledString只能在onPageShow方法设置才能生效,可以参考以下文档:
https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-universal-styled-string-V5\#styledstring