header view now receives tap events as expected
Create a great navigation header like this in SwiftUI with just a few lines of code
import SwiftUINavigationHeader struct DetailView: View { var body: some View { NavigationHeaderContainer(bottomFadeout: true) { Image("roadster") .resizable() .scaledToFill() } content: { topView .transformEffect(.init(translationX: 0, y: -100)) .padding(.bottom, -100) Text(loremIpsum) .font(.body) .padding(32) } } private var topView: some View { Image("roadster") .resizable() .scaledToFill() .clipShape(Circle()) .shadow(radius: 10) .frame(width: 200, height: 200, alignment: .center) } }
Subsequent views inside the same NavigationView should have the following added code snippet, to make sure the navigation bar is always in the correct state:
.navigationBarState(.compact, displayMode: .automatic)
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
SwiftUINavigationHeader
Create a great navigation header like this in SwiftUI with just a few lines of code
Subsequent views inside the same NavigationView should have the following added code snippet, to make sure the navigation bar is always in the correct state: