-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Side attached overlays #23
Comments
I know the question is a few months old, but I was able to achieve this by getting the current size class from the environment, and then adding padding to the overlay view. Here's a very basic example, but I can expand on it a little more if that would be helpful. struct MyOverlayView: View {
@Environment(\.horizontalSizeClass) var horizontalSizeClass
var items = Item.makeItems(50)
var body: some View {
GeometryReader { geometry in
VStack {
Text("Header")
List {
ForEach(items) {
Text($0.title)
}
}
.drivingScrollView()
}
.padding(.trailing, horizontalSizeClass == .regular ? geometry.size.width-375 : 0)
}
}
} |
@forgot I Can't access the side empty space view. Is there any solution to achieve the same like a map view in iPad |
@milettal Are you able to achieve this? |
A common use case for overlays is to have them have a fixed width and be attached to the side on a regular-width device, such as an iPad or landscape iPhone. This is true for Apple Maps.
Does this library currently support this configuration?
Very impressed with the library 👍🏻
The text was updated successfully, but these errors were encountered: