san*_*ndy 3 iphone uitableview uiview
我想在UI视图上使用并显示两个表.请让我知道如何做到这一点.任何相同的代码也将不胜感激.
谢谢,Sandeep
Vla*_*mir 16
在委托/数据源方法中,您执行以下操作:
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (tableView == myFirstTable)
// return value for 1st table
if (tableView == mySecondTable)
// return value for 2nd table
return 0;
}
Run Code Online (Sandbox Code Playgroud)或者如果您使用标记方法:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
switch(tableView.tag){
case firstTag:
// return value for 1st table
case secondTag:
// return value for 2nd table
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4850 次 |
| 最近记录: |