由于 apple 的新规则更改要求应用程序与 iPhone 5 兼容,我现在必须正确调整 UItableview(在 viewcontrollers 中,而不是 tableviewcontrollers 中)的大小。但是,有时它们不会,尤其是当它们位于 Controller 中间时。有没有办法以编程方式规定它的新大小限制,而不必摆脱我的 Storyboard 布局,例如...
tableFrame.size.height = 127
或
CGRect schedulesNewFrame = CGRectMake(self.tableView.frame.origin.x,
_movieSynopsis.frame.origin.y + _movieSynopsis.frame.size.height + 4,
self.tableView.frame.size.width,
self.tableView.contentSize.height);
[self.tableView setFrame: schedulesNewFrame];
更新 为了更好地澄清我的问题,当它自动调整大小时,有时它做得不正确。有什么方法可以手动控制它,同时让我的 Storyboard适用于普通 iPhone?
最佳答案
你可以使用
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
关于ios - 以编程方式调整 Storyboard uitableview 的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16256752/