从 Nib 制作 UITableViewCell
Making UITableViewCell from Nib
我正在尝试从 Nib 创建 UITableViewCell。
所以我的xib。文件看起来像:
我的 tableView 的每一行的高度如何根据内容大小而变化?
看看很棒的教程:
https://www.raywenderlich.com/129059/self-sizing-table-view-cells
它用于自动布局方式。但是委托方法
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
//code
}
更受青睐,因为它的速度更快。看这里:https://medium.com/ios-os-x-development/perfect-smooth-scrolling-in-uitableviews-fd609d5275a5#.i439tyds6
我正在尝试从 Nib 创建 UITableViewCell。 所以我的xib。文件看起来像:
我的 tableView 的每一行的高度如何根据内容大小而变化?
看看很棒的教程: https://www.raywenderlich.com/129059/self-sizing-table-view-cells 它用于自动布局方式。但是委托方法
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
//code
}
更受青睐,因为它的速度更快。看这里:https://medium.com/ios-os-x-development/perfect-smooth-scrolling-in-uitableviews-fd609d5275a5#.i439tyds6