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

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

Answered by yuantan in 786290022

使用UIImage加载图片

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?

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

Accepted Answer

使用UIImage加载图片

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