【发布时间】:2013-09-03 17:41:48
【问题描述】:
在进入纵向模式时,我似乎无法让视图控制器中的主 UIView 保持相同大小。屏幕截图几乎讲述了整个故事。这适用于 iPad 和 iOS 6.1、XCode 4.6。
这是screenshot of my constraints within XCode
看起来视图本身中的文本视图和按钮保持相同的位置和大小,但 UIView(它是视图控制器视图的子视图)不想保持相同的宽度和高度。
出于几个原因,我通过我的委托以编程方式加载此视图,这只是为了仅供参考 - 试图提供尽可能多的信息。
//set starting root view controller to login screen
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
DemoViewController *loginVC = (DemoViewController *)[storyboard instantiateViewControllerWithIdentifier:@"LoginVC"];
self.window.rootViewController = loginVC;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeRootVCSplit:) name:@"ChangeRootVCSplitNotification" object:nil];
我正在学习有关 AutoLayout 的所有知识,想知道是否有人可以提供帮助?如果您需要更多信息,请告诉我。感谢您的帮助。
【问题讨论】:
标签: ios xcode constraints autolayout