Not sure if this is an Apple/SwiftUI issue or an Esri issue. If I put a textfield in my view and then the keyboard is activated, when the keyboard disappears, the map view display doesn't expand back to where it was before keyboard activated. See attached photos in order 90, 91, 92
Solved! Go to Solution.
This is a Apple/SwiftUI issue. I had to wrap my MapViewReader in a scrollview and scrollview in a GeometryReader. I would have thought Apple would have a better solution by now.
GeometryReader { geo in
ScrollView() {
VStack {
MapViewReader { mapViewProxy in
MapView(map: AppData.shared.map)...
}
}
}.frame(height:geo.size.height). // ScrollView
}
The problem goes away if I remove my HStack at the bottom of the view.
This is a Apple/SwiftUI issue. I had to wrap my MapViewReader in a scrollview and scrollview in a GeometryReader. I would have thought Apple would have a better solution by now.
GeometryReader { geo in
ScrollView() {
VStack {
MapViewReader { mapViewProxy in
MapView(map: AppData.shared.map)...
}
}
}.frame(height:geo.size.height). // ScrollView
}
Hi Duane, thank you for reaching out and welcome to the new beta Swift SDK! I'm glad to see you were able to find a workaround. I'm not sure of the exact requirements you are working with but if you're able to, leaving the scroll view out entirely may also help.
If you have any further questions feel free to respond to this or open a new thread!
I had to add the scrollview to fix the initial problem of the view not being restored after the on-screen keyboard was dismissed. Even dismissed from a modal view in full screen! Since I don't fill out any text input from the main map view screen, I don't need that screen to move up when text input happens. Adding the scrollview with proper height prevents my HStack from resizing, thus fixing the issue. So far the new beta Swift SDK is working but I'm just getting started. Next item is location display. Thanks for your input.