我的应用是纵向应用,我需要在一个页面中放置两个 UITableView 对象,一个在左列,另一个在右列。
就像iPad横向模式下的分割 View 一样,我想在纵向模式下重现它。
我需要配置两个数据源和两个委托(delegate)吗?
最佳答案
是的,你可以有两个 tableView,你不需要有两个不同的数据源和委托(delegate)方法......你可以只实现方法,使用 if 条件来区分两者......
喜欢
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (tableView==tableView1){
//then perform this
}else{
//perform this.
}
}
您可以类似地实现其他委托(delegate)方法。
关于iphone - 我可以在 iPad 的单个页面中有两个 UITableView 对象吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8427549/