HomeiOS Developmentios - TabView Within NavigationStack has further inset when ignoring Protected Space

ios – TabView Within NavigationStack has further inset when ignoring Protected Space


I’m utilizing the next code to setup a TabView with a paging fashion inside a NavigationStack

struct ContentView: View {
    var physique: some View {
        NavigationStack() {
            TabView {
                Colour(.inexperienced)
            }
            .navigationTitle("Whats up")
            .tabViewStyle(.web page)
            .ignoresSafeArea(edges: .backside)
        }
    }
}

When this view first seem it seems to be effective, however as quickly as you work together with the view (e.g. swipe up) an additional inset is added on the backside of the display screen. There are fascinating points right here as properly the place for those who swipe slowly, the highest header is not going to rework to an inline fashion however will as an alternative by “frozen” and additional swiping on the view is not going to replace it.

Wanting into the view hierarchy debugger, it looks like there’s some difficulty with UIKit SwiftUI interop right here, because it seems to be just like the TabView with paging fashion falls again on the UIKit implementation, since I see UIKit views and UIHostingController within the view hierarchy. Primarily based on what I see within the debugger, There’s a SwiftUIPagingCollectionView that has the right peak, however there’s a UIKitPagingCell subview that has this further inset inflicting the problem. Additionally of notice within the view hierarchy debugger, when within the “frozen header” state, I see two headers within the view hierarchy debugger, each appear to be subviews of the UIKitNavigationBar.

Xcode 15
iOS 17

initial view
view after swipe
frozen header
enter image description here

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments