I have a title for my UINavigationBar, set by calling self.title = "self.title"
in my custom UINavigationController
and BarButtonItem
is installed in the storyboard. Does anyone know what the cause of this misalignment might be and how I would go about fixing it? The title font size is set by calling:
self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 35),NSAttributedString.Key.foregroundColor: UIColor.white]
Check this method of UINavigationBar
func setTitleVerticalPositionAdjustment(_ adjustment: CGFloat,
for barMetrics: UIBarMetrics)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.