【问题标题】:Resizing Detail View Controller in UISplitViewController [ iPad landscape only]在 UISplitViewController 中调整详细视图控制器的大小 [仅限 iPad 横向]
【发布时间】:2014-07-25 11:54:25
【问题描述】:

我正在开发 iPad 横向版本。我添加了 splitViewController 并分配了一个 viewController 作为详细视图。我在 splitViewController 之外使用这个视图控制器也作为一个完整的视图视图控制器。

问题:viewController 在 splitViewController 作为 detil 视图时没有调整大小。即视图右上角的任何东西都超出了可见区域。

P.S:我正在使用带有自动布局的情节提要,Xcode 5.1

【问题讨论】:

  • 我也看到了这个。你有没有成功解决这个问题?

标签: ios storyboard uisplitviewcontroller


【解决方案1】:

我通过以编程方式删除和添加视图来解决。

[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]; 

如果您设置了约束,segmentButtonBgView 的所有子视图都会调整大小。

【讨论】:

    猜你喜欢
    • 2013-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-27
    • 2014-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多