iOS的8自上浆细胞不UITableViewCellStyleSubtitle和numberOfLines = 0工作? [英] iOS 8 self sizing cells don't work with UITableViewCellStyleSubtitle and numberOfLines = 0?

查看:161
本文介绍了iOS的8自上浆细胞不UITableViewCellStyleSubtitle和numberOfLines = 0工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能让iOS 8的自我上浆细胞的默认单元格样式UITableViewCellStyleSubtitle和numberOfLines = 0的工作似乎只有默认的单元格样式与多个标签有这个问题。基本款式正常工作。

I can't get iOS 8 self sizing cells to work with the default cell style UITableViewCellStyleSubtitle and numberOfLines = 0. It seems that only default cell styles with multiple labels have this issue. The basic style works fine.

下面是示例项目demoing问题:
https://github.com/stevemoser/SelfSizingDemo-DefaultCellStyle

Here is sample project demoing the issue: https://github.com/stevemoser/SelfSizingDemo-DefaultCellStyle

原来的code:
http://www.appcoda.com/self-sizing-cells/

推荐答案

基本的细胞类型完全支持自上浆细胞....你只需要记住设置

The basic cell types totally support self-sizing cells....You just need to remember to set the

self.tableView.estimatedRowHeight = 44;
self.tableView.rowHeight = UITableViewAutomaticDimension;

加入那些2线,像变魔术一样它会为你工作。

Add those 2 lines and like magic it will work for you

这篇关于iOS的8自上浆细胞不UITableViewCellStyleSubtitle和numberOfLines = 0工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆