我在 UIViewController
中使用两个 UITableView
,如何填充两个 TableView 中的行和单元格?当我给出第二个 TableView 时,它显示了节中行数的重复声明等。
最佳答案
这就是为什么 dataSource/delegate 方法有一个 tableView
参数。根据其值,您可以返回不同的数字/单元格/...
- (void)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (tableView == _myTableViewOutlet1)
return 10;
else
return 20;
}
关于iphone - 如何在iPhone中的单个 View Controller 中使用两个以上的UITableView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11823565/