Last active
October 26, 2022 14:31
-
-
Save ekurutepe/a65fde8851335502ecd2b04b0367abaa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@State private var showSheetView = false | |
var body: some View { | |
VStack(spacing: 0) { | |
topBar | |
Color.blue | |
} | |
.sheet(isPresented: $showSheetView) { | |
SheetView() | |
} | |
} | |
private var topBar: some View { | |
HStack(spacing: 0) { | |
Spacer() | |
Button { | |
showSheetView = true | |
} label: { | |
Text("Sheet") | |
.padding() | |
.background(Color.red) | |
} | |
} | |
} | |
} | |
struct SheetView: View { | |
var body: some View { | |
Color.green | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Author
ekurutepe
commented
Oct 26, 2022
- Tap "Sheet"
- Background the app for a few seconds
- Open the app again
- Dismiss sheet
- Notice how the tap area for the Button is shifted down
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment