简体   繁体   English

在StoryBoard中为单个View Controller禁用自动布局

[英]Disabling AutoLayout for a single View Controller in storyBoard

I have a specific scene(view controller) in storyboard for which i do not want autoLayout. 我在情节提要中有一个特定的场景(视图控制器),我不想使用它的autoLayout。 Disabling Autolayout in storyboard disables it for the entire storyboard for all scenes. 在情节提要中禁用“自动布局”会在所有场景的整个情节提要中禁用它。 For now I am having that view controller as a separate .xib and disabling autoLayout for it. 现在,我将视图控制器作为单独的.xib并为其禁用autoLayout。 Is this the correct way of doing it or is there another option available to disable autoLayout for a particular view controller in storyboard? 这是正确的方法吗,还是有另一个选项可以为情节提要中的特定视图控制器禁用autoLayout?

Note: I have a compass implemented in this view controller. 注意:我在此视图控制器中实现了一个指南针。 The compass is jerky when autoLayout is enabled. 启用autoLayout时,指南针不平稳。 That is the reason i do not want to use autoLayout for this view controller. 这就是我不想为此视图控制器使用autoLayout的原因。

将该视图控制器的单个视图移动到其自己的XIB文件中是实现此目的的一种完全合理的方法。

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

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