Sha*_*hiq 12 iphone uitableview swift
有没有办法UITableView在swift中获得每行的行高?请帮忙.提前致谢.
Ale*_*aas 12
斯威夫特4:
var height: CGFloat = 0
for cell in tableView.visibleCells {
height += cell.bounds.height
}
Run Code Online (Sandbox Code Playgroud)
我想这就是你要找的东西.这假设"Cell"是给定行的标识符,indexPath是相关行的索引.
let row = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)as! UITableViewCell
let height = row.bounds.height
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12692 次 |
| 最近记录: |