Post marked as solved
Post marked as solved with 1 replies, 111 views
Hello Everyone,
I am developing a iOS app on Xcode. The issue which I am facing is that my app user interface looks different on the Xcode simultor / preview when compared the my real iPhone.
Take a look yourself -
Xcode simulator / preview:
Real iPhone:
Even though they running the same code and same device (simulator iPhone 13 Pro and real physical iPhone 13 Pro), the user interface looks different.
Here is the UI code:
import SwiftUI
struct ScreenView: View {
var body: some View {
NavigationView {
ZStack {
Color("Colorbg").edgesIgnoringSafeArea(.all)
VStack {
Image("testim")
.resizable()
.aspectRatio(contentMode: .fit)
Spacer()
NavigationLink(destination: ScreenView1.navigationBarHidden(true)) {
Label("Test 1", systemImage: "play.fill")
.foregroundColor(Color.white)
.font(.system(size: 57.5))
.padding(.all)
.background(Color("Colorbutton"))
.cornerRadius(20)
}
Spacer()
Label(" Test 2 ", systemImage: "play.fill")
.foregroundColor(Color.white)
.font(.system(size: 57.5))
.padding(.all)
.background(Color("Colorbutton"))
.cornerRadius(20)
.labelStyle(.titleOnly)
Spacer()
Label(" Test 3 ", systemImage: "play.fill")
.foregroundColor(Color.white)
.font(.system(size: 57.5))
.padding(.all)
.background(Color("Colorbutton"))
.cornerRadius(20)
.labelStyle(.titleOnly)
Spacer()
HStack {
NavigationLink(destination: Home().navigationBarHidden(true), label: {
Label("Home", systemImage: "house.fill")
.foregroundColor(Color.white)
.font(.system(size: 50))
.padding()
.background(Color("Colorbutton"))
.cornerRadius(30)
.labelStyle(.iconOnly)
})
Spacer()
}.padding(.leading)
Spacer()
}
}
}
}
}
struct ScreenView_Previews: PreviewProvider {
static var previews: some View {
ScreenView()
}
}
How can I fix this issue?