Closed AhmadAzam closed 2 years ago
diff --git a/ec3730/Controllers/PingViewController.swift b/ec3730/Controllers/PingViewController.swift
index 744d2d5..d8aa190 100644
--- a/ec3730/Controllers/PingViewController.swift
+++ b/ec3730/Controllers/PingViewController.swift
@@ -307,7 +307,10 @@ struct PingSwiftUIViewController: View {
}
})
}.padding()
- }.background(Color.black.ignoresSafeArea(.all, edges: .horizontal)).onTapGesture(perform: {
+ }
+ .background(Color.black.ignoresSafeArea(.all, edges: .horizontal))
+ .padding(.top, 0.15)
+ .onTapGesture(perform: {
dismissKeyboard = UUID()
})
}
@@ -328,7 +331,8 @@ struct PingSwiftUIViewController: View {
}.padding(.horizontal).padding([.vertical], 6)
}.background(VisualEffectView(effect: UIBlurEffect(style: .systemMaterial)).ignoresSafeArea(.all, edges: .horizontal)).ignoresSafeArea()
}.navigationBarTitle("Ping", displayMode: .inline)
- }.toolbar(content: {
+ }
+ .toolbar(content: {
ToolbarItem(placement: .navigationBarLeading, content: {
Button(action: { showSettings.toggle() }, label: {
Image(systemName: "gear")
Or just clip it? https://stackoverflow.com/a/71911309
https://www.hackingwithswift.com/forums/swiftui/navigation-title-and-scrollview-issue/7236
Yes clipping will also work for sure.
https://www.hackingwithswift.com/forums/swiftui/navigation-title-and-scrollview-issue/7236
Yes clipping will also work for sure.
I saw other lengthy solutions as well. But clipping and padding are the simplest one.
Alright. Let's either just change the padding number to 0.15 or use clipped. I don't think it is necessary to change the background. Please confirm that the background doesn't break on a notch etc.
Alright. Let's either just change the padding number to 0.15 or use clipped. I don't think it is necessary to change the background. Please confirm that the background doesn't break on a notch etc.
I've checked both padding 0.15 or 1 and clipped both work the same, work well on notch devices as well. Changed padding to clipped, it will help understanding code in future.
.clipped won't work. The notch messed up the background. Try landscape
The full solution is probably something like https://stackoverflow.com/a/65218077
ScrollView with bg color embedded in navigation view, overlap of scrollView on navigation issue correction. #70