我是西里沙。我是为iPhone开发的新手。我想在一个表视图中显示多行(例如:一个10,两个15,等等)请帮帮我。
发布于 2011-03-21 13:29:20
您可以使用表1中的第1节包含10第2节包含15来执行此操作
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2; //one section in the table.
},然后使用此方法添加行数。
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
//number of rows in the section如果第1节返回10,则第2节返回15
发布于 2012-04-26 19:39:08
视图中的did load应为行数组rowArray = NSArray allocinitWithObjects分配一个数组:@“A”,@"B",@"C",nil];
return 1;}
}
它将在表视图中返回包含1个部分的3行
https://stackoverflow.com/questions/5374044
复制相似问题