鸿蒙中使用iconfont
·
import font from '@ohos.font';
@Entry
@Component
struct Father {
@State message:number = 1;
aboutToAppear(): void {
font.registerFont({
familyName:'MyFont',
familySrc:'/font/iconfont.ttf'
})
}
build() {
Row(){
Text('\ue61d')
.fontFamily('MyFont')
.fontSize(30)
}
}
}
更多推荐


所有评论(0)