UItableViewの使用規則やテクニックなど

763 ワード

1  tableviewのシステムコールバック以外でcellを削除するには
 
    //   indexpath
  NSIndexPath* indexPath = [NSIndexPath indexPathForRow:row inSection:0];
  
 [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationBottom];

2 cellの背景と選択した効果を変更する
    次の2つの属性を使用します.
cell.backgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]] autorelease];
cell.selectedBackgroundView =  [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]] autorelease];

3.tableviewの分割領域と分割線を取り除く
  
tableview.separatorStyle = UITableViewCellSeparatorStyleNone;