NavigationView icon indicating copy to clipboard operation
NavigationView copied to clipboard

when set launch screen and then launch ,The screen splash white first,then show the home View

Open BestKai opened this issue 10 months ago • 1 comments

when I set the launch screen.stoaryboard and then launch . The screen splash white first,then show the home View. how to solve this

BestKai avatar Feb 17 '25 10:02 BestKai

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
    }
}

pengfei2015 avatar Mar 31 '25 13:03 pengfei2015