我想删除iPhone
应用程序中表格视图的单元格,这些单元格也是空的和隐藏的。但是这些细胞占用的空间。我们使用了这个代码
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell * cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
if([cell isKindOfClass:[IASKPSTextFieldSpecifierViewCell class]])
{
UITextField *field = ((IASKPSTextFieldSpecifierViewCell*)cell).textField;
[field setTextColor:LINPHONE_MAIN_COLOR];
}
cell.detailTextLabel.textColor = [UIColor blackColor];
// Background View
UACellBackgroundView *selectedBackgroundView = [[[UACellBackgroundView alloc] initWithFrame:CGRectZero] autorelease];
cell.selectedBackgroundView = selectedBackgroundView;
if (indexPath.section==1)
{
if (indexPath.row== 1)
{
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
}
if(indexPath.section==0)
{
//NSLog(@"value is--%@",);
if ([cell.textLabel.text isEqualToString:@"Opus 48kHz"])
{
cell.textLabel.text=@"G.711U-law";
}
if ([cell.textLabel.text isEqualToString:@"Silk 24Khz"])
{
cell.textLabel.text=@"G.711A-law";
}
if ([cell.textLabel.text isEqualToString:@"Silk 16Khz"])
{
cell.textLabel.text=@"GSM";
}
if ([cell.textLabel.text isEqualToString:@"AAC-ELD 22kHz"])
{
cell.textLabel.text=@"iLBC30";
}
if (indexPath.row==6)
{
cell.hidden=YES;
// cell=nil;
}
if (indexPath.row==7)
{
cell.hidden=YES;
//cell=nil;
}
if (indexPath.row==8)
{
cell.hidden=YES;
//cell=nil;
}
if (indexPath.row==9)
{
cell.hidden=YES;
//cell=nil;
}
if (indexPath.row==10)
{
cell.hidden=YES;
//cell=nil;
}
if (indexPath.row==11)
{
cell.hidden=YES;
//cell=nil;
}
}
else
{
cell.hidden=YES;
return cell;
}
self.tableView.separatorColor=[UIColor blackColor];
return cell;
}