SwiftUI Image
2023-06-12 本文已影响0人
yytmzys
Image, 显示环境相关图像的视图。
Image(systemName: "globe")

我们可以使用新的 SF 符号, 可以为系统图标集添加样式以匹配您使用的字体
Image(systemName: "clock.fill")
Image(systemName: "cloud.heavyrain.fill")
.foregroundColor(.red)
.font(.title)
Image(systemName: "clock")
.foregroundColor(.red)
.font(Font.system(.largeTitle).bold())

给图片添加样式
Image(systemName: "clock.fill")
.resizable() // it will sized so that it fills all the available space
.aspectRatio(contentMode: .fit)
