UITableView的使用规则和技巧等

来源:互联网 发布:吉祥抽奖软件 编辑:程序博客网 时间:2024/05/22 12:21

1  在tableview的系统回调之外使用删除某个cell

 

    //先获取indexpath  NSIndexPath* indexPath = [NSIndexPath indexPathForRow:row inSection:0];
   [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationBottom];

2 修改cell的背景以及选中效果

    运用以下两个属性

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;