Strange vertical alignment in Catalyst navigation bar titles in modal sheets w/Catalyst & macOS Sonoma

Is anyone else running into an issue with navigation bar titles in Catalyst app being shown higher up than normal when presented as a modal sheet under Sonoma (see screenshot)?

I tried adjusting the titlePositionAdjustment for the appearance, but this only affects the title and not any buttons that may be in the navigation bar, making them uneven.

Any suggestions would be helpful as I'm at my wits end on this one.

Answered by rttCanada in 771359022

You likely need create a UIBarButtonItemAppearance and adjust the titlePositionAdjustment property then set navigationBarAppearance.buttonAppearance = buttonItemAppearance. Same for navigationBarAppearance.doneButtonAppearance and navigationBarAppearance.backButtonAppearance. For the back button I had to multiply the vertical value by -1.0 to get it to be the same as the other properties. Then lastly had to apply the full appearance to the navigation bar: navigationBar.standardAppearance = navigationBarAppearance navigationBar.scrollEdgeAppearance = navigationBarAppearance

Created feedback FB13289026 for this in case anyone at Apple is interested in looking at this (please?).

Accepted Answer

You likely need create a UIBarButtonItemAppearance and adjust the titlePositionAdjustment property then set navigationBarAppearance.buttonAppearance = buttonItemAppearance. Same for navigationBarAppearance.doneButtonAppearance and navigationBarAppearance.backButtonAppearance. For the back button I had to multiply the vertical value by -1.0 to get it to be the same as the other properties. Then lastly had to apply the full appearance to the navigation bar: navigationBar.standardAppearance = navigationBarAppearance navigationBar.scrollEdgeAppearance = navigationBarAppearance

Strange vertical alignment in Catalyst navigation bar titles in modal sheets w/Catalyst & macOS Sonoma
 
 
Q