【鸿蒙】ArkTS 系统图标 sys.symbol

记录如何使用鸿蒙系统提供的图标,及图标代码和图形对照。

【鸿蒙】ArkTS 系统图标 sys.symbol

By img Microanswer Create at:Aug 4, 2024, 12:04:49 AM 

Tags: 鸿蒙 ArkTS 图标

记录如何使用鸿蒙系统提供的图标,及图标代码和图形对照。


一、实现小图标效果

在鸿蒙应用开发过程中,如果遇到需要使用小图标的场景时,我们可以使用 SymbolGlyph 这个组件来实现。比如说像下面的这段代码:

build() {
  Row(){
    SymbolGlyph($r("sys.symbol.trash")).fontSize(24)
    Text("删除")
  }
}

就可以得到效果:

二、系统小图标代码对照

你可以 点击这里 跳转到鸿蒙官方网站里去查找对应想使用的图标。

这里还有一个鸿蒙官方的图标库:鸿蒙图标库

Full text complete, Reproduction please indicate the source. Help you? Not as good as one:
Comment(Comments need to be logged in. You are not logged in.)
You need to log in before you can comment.

Comments (0 Comments)