能把Shape配置成Text的背景吗?

能把Shape配置成Text的背景吗?

HarmonyOS
2024-06-03 23:46:12
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
是潘达不是胖达

示例代码,可以配置背景图片,然后内部用Text

示例代码

Shape() { 
  Text('path').fontSize(18).fontColor(0xCCCCCC).width(320) 
} 
.width(350) 
.height(140) 
// .backgroundColor(Color.Red) 
.backgroundImage($r("app.media.app_icon"))
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
分享
微博
QQ
微信
回复
2024-06-04 22:39:51
相关问题
HarmonyOS 有没有xml描述Shape
656浏览 • 1回复 待解决
51CTO不能把上传图片搞清晰一点?
4610浏览 • 2回复 待解决
怎样能把快应用完全关闭
9806浏览 • 1回复 待解决
HarmonyOS Text支持修改FontFamily
496浏览 • 1回复 待解决
HarmonyOS Textspan不能设置间距
633浏览 • 1回复 待解决
关于text内容删除问题有懂
3540浏览 • 1回复 待解决
Text模拟隐私协议,有好方案
1543浏览 • 1回复 待解决
HarmonyOS Text组件支持html标签
663浏览 • 1回复 待解决