美文网首页
IOS-UITableView-cell的高度设置

IOS-UITableView-cell的高度设置

作者: 久百一 | 来源:发表于2019-12-16 18:51 被阅读0次

要修改cell的高度,必须修改tableview的row height,而不是tableviewcell的row height


在代码里用:

tableView.rowHeight = 100

如果每个cell高度都不同的话,可以用delegate方法:

override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        //...
    }

相关文章

网友评论

      本文标题:IOS-UITableView-cell的高度设置

      本文链接:https://www.haomeiwen.com/subject/agwdnctx.html