Hi all,
I was aiming to create a similar navigation bar experience like the ones in Apple Music and Books.
Some characteristics they all have:
- Single line navigation title w/ a button (avatar) on the same line
- Displays the system default
navigationTitle(.inline)
style when scrolled (into safe area?). - From the scroll bar I deduce that this is some sort of system behavior because the scroll bar does not start from the top of the page but from where the inline navbar appears.
I'm trying to build this with SwiftUI, and I encountered some issues that I can't wrap my head around:
.navigationTitle
combined with.toolbar
does not work as they present in aVStack
-like view.- Even with
.toolbarTitleDisplayMode(.inlineLarge)
and.toolbar
these two aren't perfectly horizontal
- Build a custom header with
HStack
and a customgeometry reader
reading the globalTopInsets
and tries to programatically display the inlined version of the navbar causes the scroll bar to behave weird and I don't seem to be able to find a good value for the intersection.
Does anyone know if it's possible to achieve the same result with purely swiftUI? If not, can the same be achieved with UIKit?
Thanks!