I tried to display the screen of the app according to the screen width, but it seems that the size of geometry differs depending on the simulator.
Is there a way to get the correct size?
Target
iPad mini
pixcel width: 768
geometory pixcel width: 744
Others
iPhone12 mini
pixcel width: 375
geometory pixcel width: 375
iPad 9.7inch
pixcel width: 768
geometory pixcel width: 768
iPad 12.9inch
pixcel width: 1024
geometory pixcel width: 1024
iPhone8
pixcel width: 375
geometory pixcel width: 375
Code
struct ContentView: View {
var body: some View {
GeometryReader {GeometryProxy in
Text("Hello, World!")
.padding()
.background(GeometryReader{ geometry -> Text in
// size → frame
print("******",geometry.frame(in: .global))
return Text("")
})
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
.fullScreenCover is not working in iOS simulator iPhone12(14.1) and iPad Pro(9.7-inch)(14.1).
But ,iOS simulator iPhone12(14.5) work that.
How to .fullScreenCover work in iOS14.1?
Xcode version 13.1
iOS simulator version 13.1