TableViewCell的美化及带动画插入行

来源:互联网 发布:数据字典和数据流程图 编辑:程序博客网 时间:2024/06/05 00:39
带动画的插入行:

NSIndexPath * indexPath =

    [NSIndexPath indexPathForRow:self.memos.count - 1 inSection:0];

    [self.tableView insertRowsAtIndexPaths:@[indexPath]

                          withRowAnimation:UITableViewRowAnimationAutomatic];


UITableViewCell 
  属性:
        .backgroundImage
        .selectedImage

设置表格 无边线 的代码:
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone ; 
   界面设置则在 第四个检查器下面的  TableView  下面的Separator 进行设置

清理cell的Label 的背景颜色:
        cell.textLabel.backgroundColor =  [ UIColor clearColor ] ;

更改cell 选中背景颜色的方法:
      UIImage* image = [UIImage imageWithNamed:@" XXX.png "] ;
      cell.selectedView = [ [ UIImageView alloc] initWithImage:image] ;


注意:  
       后期如果需要自定义cell用于程序中,则 只要将上面的cell 美化界面 放置在 自定义cell 的初始化方法中 .
0 0
原创粉丝点击