【发布时间】:2015-06-02 22:03:03
【问题描述】:
我在将动态单元格添加到 UIScrollView 内的动态 UITableView 时遇到问题。滚动视图不会一直滚动到底部。下面您将看到最大滚动,在表格末尾隐藏了另外两个单元格。我正在使用自动布局,但不知道如何解决这个问题。
- (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section {
[self setTableHeight];
return [player.metas count];
}
- (void)setTableHeight
{
long tableHeightCalculated = 44 * [player.metas count];
metaTableView.frame = CGRectMake(metaTableView.frame.origin.x, metaTableView.frame.origin.y,
metaTableView.frame.size.width, tableHeightCalculated);
}
【问题讨论】:
-
如果您使用的是静态表格视图,您甚至不应该实现任何数据源方法(如 numberOfRowsInSection)。
-
它是一个动态表。
标签: ios iphone xcode uiscrollview autolayout