如何在单个视图中实现多个uitableview? [英] How can I Implement multiple uitableview in a single view?

查看:149
本文介绍了如何在单个视图中实现多个uitableview?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁能告诉我如何在一个视图中显示多个UITableView?

Can anyone tell me how I can show multiple UITableViews in a single view?

推荐答案

1)使用绘制不同的表视图不同的帧/拖放不同大小的表视图,如果使用XiB。

1) Draw different table views using different frames/ Drag and drop table views of different sizes, if using XiB.

2)照常遵守表视图协议并为委托/数据源方法提供实现

2) Conform to table view protocols as usual and give implementation for delegate/datasource methods

3)在委托/数据源方法中,使用表视图的对象决定调用哪个表视图。例如:

3) In the delegate/datasource methods decide for which table view, it was called, using the table view's object. for example:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
{
    if(tableView == tableView1)
{
        //Do this
}
else if(tableView == tableView2)
{
        //Do that
}
}

这篇关于如何在单个视图中实现多个uitableview?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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