我正在尝试将图像与 Swift/SwiftUI 中的屏幕中心对齐。
GeometryReader { geometry in
HStack {
Spacer()
Color.white
.ignoresSafeArea()
Image("1Pzpe")
.frame(width: geometry.size.width-3, height: geometry.size.width-3, alignment: .center)
Spacer()
}
在此处输入图像描述 而不是居中,我的图像向右移动了一点。任何帮助将不胜感激 :)