我得到UITableView
自定义空单元格UITabelView
我定制的细胞在这个表iOS应用程序,但是当与屏幕上可见单元格较低对象的数量,所有其他细胞的样子简单UITableViewCells。
它应该是这样的
我应该如何自定义所有的细胞?
UPD代码为数据源:
pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [dataBase.showMaps count];
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 70;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
ShowMapCell *cell = (ShowMapCell*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[ShowMapCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// Configure the cell...
ShowMap *sM = [dataBase.showMaps objectAtIndex:indexPath.row];
//cell.textLabel.text = sM.name;
[cell initShowMapCell:sM index:indexPath.row];
return cell;
}
把relavent代码放在这里:) – iPatel 2013-03-20 11:58:40
请发布你的代码,特别是你的数据源和UITableView的委托方法。 – Tim 2013-03-20 12:02:47
@iPatel你可以在upd中看到我的代码。 – 2013-03-20 12:09:22