Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的项目中有一个in Xcode ,UITableView我设置rowHeight为44.StoryBoard
UITableView
rowHeight
44
StoryBoard
在 iOS7 中一切都很好,但在 iOS8 rowHeight 返回值-1导致我的表格视图不显示。
在 iOS 8 中,Apple 为 UITableView 引入了一项称为 Self Sizing Cells 的新功能。如果要在可变高度的表格视图中显示动态内容,则需要手动计算行高。
tableView.estimatedRowHeight = 44.0 tableView.rowHeight = UITableViewAutomaticDimension
这是演示http://www.appcoda.com/self-sizing-cells/