【发布时间】:2019-05-27 01:23:40
【问题描述】:
我的 UINavigationBar 有一个标题,通过在我的自定义 UINavigationController 中调用 self.title = "self.title" 设置,BarButtonItem 安装在情节提要中。有谁知道这种错位的原因可能是什么以及我将如何解决它?标题字体大小通过调用设置:
self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 35),NSAttributedString.Key.foregroundColor: UIColor.white]
【问题讨论】:
-
错位在哪里?
-
@ShauketSheikh 我想要的对齐方式是 title 和 barbutton 匹配的 centerY,但目前两者的底部相互对齐。如何将其更改为 centerY 对齐?
-
您是否使用图像作为条形按钮?如果您正在使用然后更改图像的大小并再次放在那里它将被对齐
标签: swift uinavigationcontroller uibarbuttonitem