Skip to content

Removing backgrounds from a NavigationSplitView #292

Closed Answered by davdroman
slaght asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for your question, @slaght.

Indeed, setting backgroundColors via introspection is flakey. SwiftUI insists on overriding the background color of its UIKit components on each state update. However, I'm not convinced this is necessarily a problem begging for introspection, as nowadays SwiftUI offers modifiers to clear out a number of backgrounds. Instead, a hybrid approach might be best.

Here's what I came up with:

https://github.com/davdroman/NavigationSplitViewRemoveBackgrounds

Note I took the liberty to drop in a .navigationTransition(.slide) modifier from my https://github.com/davdroman/swiftui-navigation-transitions library to make the transition smoother, because the default iOS…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@slaght
Comment options

Answer selected by slaght
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants