1

我在 viewController 中保留了一个 tableview。ViewController 在容器视图中。

问题是布局会随着设备的旋转而改变。这不是一个约束问题,因为它只发生在轮换中。

这就是我所做的

-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{

    CGSize contentSize = self.affiliationListTableView.contentSize;
    contentSize.width = self.affiliationListTableView.superview.superview.superview.bounds.size.width;
  //  contentSize.height = self.affiliationListTableView.superview.bounds.size.height;
    self.affiliationListTableView.contentSize = contentSize;


}

我注意到 contentSize 会随着旋转而变化。这是苹果方面的错误吗?如果我们使用 UITableViewController 而不是 UIViewController,这不会发生。但是要求不允许我使用 UITableViewController

最初查看纵向

旋转后查看

请提供任何建议/想法

4

0 回答 0