UITableViewCell 专辑

来源:互联网 发布:女生问你喜欢我吗 知乎 编辑:程序博客网 时间:2024/05/02 04:20

自适应高度的方案

有三种策略可以调节Cell(或者是Header和Footer)的高度: 

a.调节Height属性

b.通过委托方法tableView: heightForRowAtIndexPath:

c.Cell的“自排列”(self-sizing)


设置不可点击或者没有选中状态


方法1: 就像把按钮的enabled设为NO一样,cell.userInteractionEnabled = NO; 

方法2:[cell setSelectionStyle:UITableViewCellSelectionStyleNone]; 

方法3: 

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    return nil;
} 

IOS8 不用计算Cell高度的TableView实现方案

  http://my.oschina.net/u/1418722/blog/322623?p=1 原文

使用Autolayout实现UITableView的Cell动态布局和高度动态改变


http://www.imooc.com/wenda/detail/245446

iOS 8自动调整UITableView和UICollectionView布局

  http://www.cocoachina.com/industry/20140825/9450.html



0 0
原创粉丝点击