Xcode 8 中的自动调整大小问题 [英] Autoresizing issue in Xcode 8

查看:20
本文介绍了Xcode 8 中的自动调整大小问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

=== 编辑 ========

=== EDIT ========

此问题现已在 Xcode 8.1 中得到解决.我查过了.

This issue is now solved in Xcode 8.1. I have checked.

================

================

我不太了解自动布局.所以,我在我的所有应用程序中都使用了自动调整大小选项,这对我来说很好.这样我就可以毫无问题地满足我的所有要求.

I don't know auto-layout properly. So, I am using autoresizing option in my all apps and it's fine for me. I am able to fulfill my all requirements by this without any issue.

现在在 Xcode 8 中,我已将旧的 swift 项目迁移到 swift 3.现在出现了问题.

Now in Xcode 8, I have migrated my old swift project to swift 3. Now issue arises.

如图所示,我已经设置了自动调整大小,到目前为止它在所有设备上都没有问题,并且这个项目在 AppStore 中运行,所以我无法显示 UI 或故事板.

See in image, I have set Autoresizing, and its working fine without issue in all devices until now and this project is live in AppStore, so that I can't show the UI or storyboard.

现在我必须在项目中做一些更新.所以我现在在 Xcode 8 中工作.但是我的自动调整无法正常工作,因为所有控件都位于中心并且用户界面一团糟.

Now I have to do some update in project. So I am working in Xcode 8 now. But my autoresizing not working properly, as all the controls are come in center and UI is messed up.

该问题在设备中也仍然存在.我也检查了模拟器和设备.但问题也存在.任何建议和帮助将不胜感激.提前致谢.

And the issue persists in device also. I have checked in simulator and device as well. But problem is there also. Any suggestion and help will be appreciated. Thanks in advance.

昨天只有运行时有问题,但今天故事板也改变了像这张图片一样的视图

Yesterday there is issue in runtime only, But Today storyboard also changed views like this image

这意味着整个 UI 设计都搞砸了.这很奇怪.

Which means the whole UI design is messed up. This is weird.

推荐答案

请尝试取消选中来自 xib 或故事板的自动调整大小.并在viewDidLoad中设置[_scrollView setAutoresizesSubviews:YES];

Please try to uncheck autoresizing from xib or storyboard. And inviewDidLoad set [_scrollView setAutoresizesSubviews:YES];

如果这能解决您的问题,请尝试

Try it if this solve your problem

如果是情节提要,请取消选中Resize view from NIB 选项.

In case of storyboard uncheck Resize view from NIB option.

这篇关于Xcode 8 中的自动调整大小问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆