如何在适用于iPad的View Controller中创建多个表视图? [英] How to create multiple table view in a View Controller for iPad?

查看:124
本文介绍了如何在适用于iPad的View Controller中创建多个表视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用通用应用。现在我想在iPAD的视图控制器中创建三个表视图。我有三个独立的视图控制器与XIB.So我如何在主控制器中添加另外两个表视图作为子视图。请给我一些示例应用程序和链接。在我的应用程序中,我有三个视图控制器并添加一个子视图作为表视图(而不是UITableViewController)。在单击第一个表视图数据时,它导航到第二个表并单击第二个表视图数据,它导航到第三个表视图。

I am working with the universal apps. Now i want to create a three table views in my view controller for iPAD. I have three separate view controllers with XIB.So how can i add the other two table view as subview in the main controllers. Please give me some sample applications and links. In my application, i have three view controllers and add a subview as table view(not UITableViewController). On clicks the first table view data, it navigates to the second table and clicks the second table view data, it navigates to the third table view.

 Hierarchy:

   MainViewController:
     --SubTableView1 
     --SubTableView2 

见下图,

See the image below,

请帮帮我。

谢谢!!

推荐答案

表视图只是一个可以使用的视图。它不必以1:1的方式绑定到视图控制器,但如果不是,则需要设置拥有该屏幕的自定义单视图控制器,然后将其作为子视图拥有所有三个表视图。您需要注意哪个对象是每个视图的委托和数据源,并通过提供单元格等来做正确的事情。如果同一个控制器是所有表视图的委托/数据源,则必须切换委托方法在每个方面做正确的事。

A table view is just a view you can use. It doesn't have to be bound 1:1 to a view controller, but if it's not, you need to set up the custom single view controller that owns the screen, and then get it to own all three table views as subviews. You need to be careful about which object is the delegate and data source of each views, and do the right thing with providing cells, etc. If the same controller is the delegate/data source of all the table views, you have to switch in the delegate methods to do the right thing on each.

这篇关于如何在适用于iPad的View Controller中创建多个表视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆