简体   繁体   English

Xcode 9.0 iOS11搞砸了UIBarButtonItem

[英]Xcode 9.0 iOS11 Has Screwed Up Right UIBarButtonItem

older version of xcode (8.3.3) xcode的旧版本(8.3.3) 在此处输入图片说明

newer version of Xcode (9.0) Xcode的较新版本(9.0) 在此处输入图片说明

Any idea what happened to the hearts+number (favorites) in storyboard? 知道故事板上的心+数字(收藏夹)发生了什么吗? When I run the app, it's also still wrong. 当我运行该应用程序时,它仍然是错误的。

View Structure 视图结构

视图结构

Constraints of Favorites Background View 收藏夹背景视图的约束

在此处输入图片说明

The solution for us was to use Safe Area Layout Guides and fix any autolayout constraint issues. 我们的解决方案是使用“安全区域布局指南”并解决任何自动布局约束问题。

As a side note:, we tried changing it from just using the bar to a full UINavigationController approach. 作为一个侧面说明:,我们尝试将其从仅使用条变为完整的UINavigationController方法。 That looked promising. 看起来很有希望。 However, changing the tintColor status bar didn't work programmatically. 但是,更改tintColor状态栏无法以编程方式进行。 So, we had to go back to the bar approach. 因此,我们不得不回到标准方法。

You must use Safe Area Layout Guides or add constraint to margins. 您必须使用“安全区域布局指南”或对边距添加约束。 If this not helps - try add constraint to superview. 如果这没有帮助-请尝试将约束添加到超级视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM