简体   繁体   English

在UISplitViewController中调整详细视图控制器的大小[仅限于iPad横向]

[英]Resizing Detail View Controller in UISplitViewController [ iPad landscape only]

I am working on iPad landscape only version. 我正在使用仅限iPad横向版本。 I added splitViewController and assigned a viewController as detail view. 我添加了splitViewController并分配了一个viewController作为详细视图。 I am using this view controller out side the splitViewController also as a full view viewController. 我在splitViewController之外还使用了这个视图控制器作为全视图viewController。

Problem : viewController is not resizing when its in splitViewController as detil view. 问题:viewController在splitViewController中作为detil视图时,无法调整大小。 ie anyting which is on right corner of the view is out of visibel area. 即,位于视图右上角的任何内容均不在可视区域内。

PS : I am using storyboard with autolayout ,Xcode 5.1 PS:我正在使用自动布局的情节提要,Xcode 5.1

I solved by removing and adding back the view programmatically . 我通过以编程方式删除和重新添加视图来解决。

[self.segmentButtonBgView removeFromSuperview];
[self.segmentButtonBgView setTranslatesAutoresizingMaskIntoConstraints:YES];
[self.segmentButtonBgView setFrame:CGRectMake(self.segmentButtonBgView.frame.origin.x-158, self.segmentButtonBgView.frame.origin.y,405, self.segmentButtonBgView.frame.size.height)];
[self.view addSubview:self.segmentButtonBgView]; 

All subviews of segmentButtonBgView will resize if you have set constraints. 如果设置了约束,那么segmentButtonBgView的所有子视图都会调整大小。

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

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