UITableView使用自定义cell的例子

使用的是MVC编程框架,KVO数据模型,仅供参考

源码下载地址:TableViewTest.zip





让TableView开始的CELL下移一段距离的代码


m_tableView.contentInset = UIEdgeInsetsMake(32, 0, 0, 0);




Tableview半透明效果

只需加入如下代码:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
    UIColor *altCellColor = [UIColor colorWithWhite:1.0 alpha:0.6];
    
    cell.backgroundColor = altCellColor;
    altCellColor = [UIColor colorWithWhite:1.0 alpha:0.0];
    cell.textLabel.backgroundColor = altCellColor;
    cell.detailTextLabel.backgroundColor = altCellColor;
}


你可能感兴趣的:(UITableView使用自定义cell的例子)