[英]Swift 4 iOS 11 navigation bar back button is pushed by a title view with long text
For a long title on iOS 11, the back button arrow and text are not showing. 对于iOS 11上的长标题,后退按钮箭头和文本不会显示。
I searched for a solution and the closest I got was navigation bar rightbaritem image-button bug iOS 11 我搜索了一个解决方案,得到的最接近的是导航栏rightbaritem image-button bug iOS 11
It looks like this 看起来像这样
When it should look like this for long titles also 长标题也应该像这样
My problem though is that I don't have an explicit button added, instead the titleview pushes the "< Back" default leftBarButtonItem that I create: 我的问题是,我没有添加显式按钮,而是titleview推送了我创建的默认“ <Back” leftBarButtonItem:
navigationItem.backBarButtonItem = UIBarButtonItem(title: NSLocalizedString("Back", comment: ""), style: .plain, target: nil, action: nil)
How can I add constraints to that (UIBarButtonItem)? 如何为该(UIBarButtonItem)添加约束?
最后,我降低了titleviews文本的抗压缩性,因此长条按钮项具有更高的优先级,一切都准备就绪。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.