NavigationView
NavigationView copied to clipboard
when set launch screen and then launch ,The screen splash white first,then show the home View
when I set the launch screen.stoaryboard and then launch . The screen splash white first,then show the home View. how to solve this
I had the same problem. This feeling is the reason for the background color of NavigationView. I just added background to it
struct NavigationView: View {
let config: NavigationGlobalConfig
@ObservedObject private var stack: NavigationManager = .shared
@ObservedObject private var screenManager: ScreenManager = .shared
@ObservedObject private var keyboardManager: KeyboardManager = .shared
@GestureState private var isGestureActive: Bool = false
@State private var temporaryViews: [AnyNavigatableView] = []
@State private var animatableData: AnimatableData = .init()
@State private var gestureData: GestureData = .init()
var body: some View {
ZStack { ForEach(temporaryViews, id: \.id, content: createItem) }
.ignoresSafeArea()
.frame(maxWidth: .infinity, maxHeight: .infinity)
.gesture(createDragGesture())
.onChange(of: stack.views, perform: onViewsChanged)
.onChange(of: isGestureActive, perform: onDragGestureEnded)
.onAnimationCompleted(for: animatableData.opacity, perform: onAnimationCompleted)
.animation(.keyboard(withDelay: isKeyboardVisible), value: isKeyboardVisible)
.background(config.backgroundColour) // added background to it
}
}