cell自适应高度

https://stackoverflow.com/questions/18746929/using-auto-layout-in-uitableview-for-dynamic-cell-layouts-variable-row-heights/18746930#18746930

一:
自定义的cell中,加入的子view要把cell的contentview的top和bottom都粘住
这样cell的中的元素就可以决定cell的contentview的高度
这种方法下面这个博客也有介绍,亲测可用
http://blog.csdn.net/studying_ios/article/details/54094305

二:
如果你的cell不仅仅高度会变化,更有多种布局,可以采用每种布局一个reuse id的做法。

上面两种方法不分系统版本,都可以使用

你可能感兴趣的:(cell自适应高度)