iphone - 我可以在 iPad 的单个页面中有两个 UITableView 对象吗?

标签 iphone ios ipad

我的应用是纵向应用,我需要在一个页面中放置两个 UITableView 对象,一个在左列,另一个在右列。

就像iPad横向模式下的分割 View 一样,我想在纵向模式下重现它。

我需要配置两个数据源和两个委托(delegate)吗?

enter image description here

最佳答案

是的,你可以有两个 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/

相关文章:

iphone - 试图划分UIBezierPath

ios - 根据键的值对来自 Web 服务的数据进行排序

ios - mainMixerNode 快速崩溃

iphone - Iphone/iPad 上的 Java - Java 模拟器/代理?

ios - 在 iOS 中对包含字母数字单词的数组进行排序

iphone - 在 iPhone 中显示从 ALAsset 检索到的 URL 中的图像

iphone - 将 NSDecimalNumber 与 NSDecimalNumber 相乘返回 0

ios - 如何在UIPageViewController最后一页向右滑动时弹出消息?

ios - UIPopoverBackgroundView 边框缩小

ios - 长按模式下的 Collection View 时,如何移动 Collection View 单元格并在 iOS 中重新排列它们?