Skip to content

change theme for ReaderView inside NavigationStack #2

@sergeydi

Description

@sergeydi

I use this code to show ReaderView:

var body: some View {
    NavigationStack {
        VStack {
            ReaderView(controller: viewModel.readerController)
                .ignoresSafeArea()
        }
        .onAppear {
            viewModel.loadBook()
        }
    }
}

I have a button to change theme.

class ContentViewModel {
    ...
    func setTheme(_ theme: Theme) {
        Task {
            try? await readerController.change(theme: theme)
        }
    }
}

When I change theme, it changed, but I have a problem with Navigation Bar:
Start theme:

Set dark theme (Book scroll is on top, Navigation Bar is white):

Scroll book a little bit down:

How to fix the issue with Navigation Bar theme when Book scroll is on top?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions