WatchOS accessoryInline类型的Widget 不展示自定义png图片

WatchOS accessoryInline类型的表盘组件不展示自定义的png图片

Accepted Reply

使用UIImage加载图片

Replies

You can definitely add a symbol, using this:

HStack {
    Image(systemName: "popcorn")
    Text("Some text")
}

So I wonder if you can use your own PNG file from the assets. What have you tried?

  • Just same as you,but the image is like the follow HStack { Image(name: "customImage") Text("Some text") }

    image size 12 * 12

Add a Comment

https://developer.apple.com/documentation/uikit/uiimage/creating_custom_symbol_images_for_your_app#3875972 https://developer.apple.com/documentation/uikit/uiimage/configuring_and_displaying_symbol_images_in_your_ui

使用UIImage加载图片