iPhone开发UITable内嵌不同风格Table

2014-11-24 10:31:31 · 作者: · 浏览: 0

那么可以在制作table内嵌table吗。起初怀疑这样表格的滑动会出现问题,不过,在尝试之后发现,不但是可以实现,而且效果非常好。


至于代码中的delefat和datasource只要有指定tag来相应就可以了。


我简单的在一个UITableViewController中的tableFooterView添加了一个group的table,各个功能都正常,没有出现问题。


self.title = @"TableInTable";


UITableView *table = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 200) style:UITableViewStyleGrouped];


table.delegate = self;


table.dataSource = self;


// table.scrollEnabled = NO;


self.tableView.tableFooterView = table;


delegatedataSource和当前的table一致,或者可以单独制定delegatehelper来实现数据源的处理,就可以实现一些比较变态的需求。


简单效果如下