Xcoder6.1.1 坑之一

2015-02-04  本文已影响917人  funpig

今天在Xcoder6.1.1下遇到了UITableView的坑。运行时警告如下:

Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the collapse unintentional and using standard height instead.

Google后得到解决方法:


self.tableView.rowHeight = 44;


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

{

return 44;

}

上面的方法的确能够避免警告的产生

但是,如果你的cell不等于44,而且autolayout布局不完美的话,cell是实际高度还是44,问题并没有解决!

举例说明:

总结

上一篇 下一篇

猜你喜欢

热点阅读