SyncServerII / Neebla

Private and Self-Owned Social Media
MIT License
1 stars 2 forks source link

Nav bar disappearing #22

Open crspybits opened 3 years ago

crspybits commented 3 years ago

Dany is seeing this on iPad.

https://stackoverflow.com/questions/65195362/swiftui-navigation-bar-items-disappear-on-ios-14

crspybits commented 3 years ago

See .toolbar title method: https://sarunw.com/posts/custom-navigation-bar-title-view-in-swiftui/

crspybits commented 3 years ago

This is not just when there is a toolbar. I removed that in the Media Items Details screen, and I still get the back button dissappearing. See also https://developer.apple.com/forums/thread/662449

crspybits commented 3 years ago

And add .navigationViewStyle(StackNavigationViewStyle()) to the Media Item Details screen doesn't help. I added it when I didn't have the .toolbar.

crspybits commented 3 years ago

Tried replacing RefreshableScrollView with ScrollView and that doesn't help.

crspybits commented 3 years ago

Tried adding RefreshableScrollView to the object details view and it seems to help-- seems to delay getting the disappearing nav bar, but it still happens.

crspybits commented 3 years ago

I tried adding .navigationBarBackButtonHidden(false) to the object details view, and it doesn't solve the problem.

crspybits commented 3 years ago

Adding both together:

.navigationBarHidden(false) .navigationBarBackButtonHidden(false)

Doesn't solve the problem.

crspybits commented 3 years ago

I see in the developer console:

2021-06-29 06:40:34.168910-0600 Neebla[5311:2029685] [Assert] displayModeButtonItem is internally managed and not exposed for DoubleColumn style. Returning an empty, disconnected UIBarButtonItem to fulfill the non-null contract.

This is from debugging the nav bar:

Printing description of $16: <_UIButtonBarButton: 0x125f0ac10; frame = (0 0; 0 44); tintColor = UIExtendedSRGBColorSpace 0.0392157 0.517647 1 1; layer = <CALayer: 0x282d08940>>

crspybits commented 3 years ago

See https://developer.apple.com/forums/thread/668433 https://developer.apple.com/forums/thread/660265

The solution suggested here seems to have worked: https://developer.apple.com/forums/thread/660265

I've added .navigationViewStyle(StackNavigationViewStyle()) directly to the NavigationView-- unfortunately that had to be done in the SideMenu package.

Unfortunately that does change the background color (and size) of the main album list screen. To:

IMG_0049

From:

IMG_0050

crspybits commented 3 years ago

For this styling issue, see https://stackoverflow.com/questions/58519018/how-to-set-scrollviews-background-color-in-navigationview-in-swiftui