我有一个 iPad 应用程序,它在另一个视图中有一个小 UITableView,但是当我添加足够多的单元格时,ScrollView 不会增长,为什么?
@edit:我的意思是我无法滚动,因为它会弹回顶部。
这是tableview的framechange的代码:
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration {
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft
|| toInterfaceOrientation == UIInterfaceOrientationLandscapeRight){
CGRect rect = _table.frame;
rect.size.height = 565;
_table.frame = rect;
//_table.contentSize = CGSizeMake(_table.contentSize.width, 1000); // Doesn't work
}else{
CGRect rect = _table.frame;
rect.size.height = 820;
_table.frame = rect;
_table.contentSize = rect.size;
//_table.contentSize = CGSizeMake(_table.contentSize.width, 1000); // Doesn't work
}}