私はこのコードを持っています:
struct ContentView: View {
var body: some View {
ZStack {
Image("bird")
.resizable()
.aspectRatio(contentMode: .fill)
.edgesIgnoringSafeArea(.all)
Image(systemName: "camera.on.rectangle")
.offset(x: 160, y: -380)
.font(.largeTitle)
Image(systemName: "heart")
.offset(x: -160, y: 380)
.font(.largeTitle)
.foregroundColor(.red)
Image(systemName: "square.and.arrow.up.on.square")
.offset(x: -160, y: -380)
.font(.largeTitle)
}
}
}
を使用し.offset
て、特定の場所を画像に設定します。しかし、別のデバイス形式に変更すると、それらは離れていきます。SwiftUI で適切に機能するように、このコードを制約または改善する方法はありますか?
ありがとう。