1. 首页
  2. 数据库
  3. 其它
  4. UITableViewCell自适应大小

UITableViewCell自适应大小

上传者: 2021-05-08 21:45:01上传 ZIP文件 36.13KB 热度 24次
源码AutoSizeTableViewCell,UITableViewCell自适应大小(各种场合下的处理)。 关键的两句: tableView.estimatedRowHeight = 44 tableView.rowHeight = UITableViewAutomaticDimension 场合1: 只有一个UILabel 场合2: 有多个UILabel,相互之间有约束 场合3: 只有一个UILabel,但是未设置Bottom的底部约束,导致UITableViewCell不能自适应高度.(默认高度为44) 场合4: 因为没有UILabel,所以UITableViewCell不能自适应高度.(默认高度为44) 环境: XCode7,Swift2.0 系统: IOS8.0以上
下载地址
用户评论