iOS实现Cell自适应高度
来源:互联网 发布:外汇手机看盘软件 编辑:程序博客网 时间:2024/05/21 23:31
1.实现UITableViewDelegate中的方法
先设置cell的contentview中label根据内容自动换行
numberOfLines=0
实现UITableViewDelegate中的方法
- (CGFloat)tableView:(UITableView )tableView estimatedHeightForRowAtIndexPath:(NSIndexPath )indexPath{
return UITableViewAutomaticDimension;
}
2.根据content view设置cell的frame
先设置cell的contentview中label根据内容自动换行
numberOfLines=0
cell根据Label大小 修改cell此时的尺寸
CGRect bounds = cell.contentLb.bounds;
bounds.size.height = bounds.size.height + 10;
cell.bounds = bounds;
或者在viewDidLoad里写下这两句
self.chatTableView.rowHeight = UITableViewAutomaticDimension;self.chatTableView.estimatedRowHeight = 70;//这句必须写上值可以为自己估算的cell的高
1 0
- iOS实现Cell自适应高度
- iOS Cell高度自适应
- ios cell自适应高度
- iOS cell 自适应高度
- iOS 自定义Cell 自适应高度
- iOS 8 自适应 Cell高度
- IOS--UI Cell 自适应高度
- iOS 之cell自适应高度
- iOS cell高度自适应_动态调节cell高度
- iOS 8cell的高度的自适应
- iOS编程------自定义UITableViewCell / cell自适应高度
- ios-cell多行文字高度自适应
- iOS中的cell自适应高度--StoryBorad
- iOS开发中cell高度的自适应
- IOS 开发之 cell高度自适应
- 【iOS开发】UITableView Cell 自适应高度
- [iOS]TableView的Cell高度自适应
- IOS UItableview UIcollectionview cell高度自适应
- drbd使用(转载)
- android测试之二:monkey测试
- Android_自定义标签换行
- ViewPager 详解(五)-----使用Fragment实现ViewPager滑动
- pdf显示插件
- iOS实现Cell自适应高度
- windbg符号表路劲设置成功后没有自动下载
- spin_lock_irqsave关中断后,为什么要再禁止抢占呢,不多余吗?
- android 为什么不建议使用Thread.stop()
- HTML控件 隐藏
- 每天工作4小时的程序员
- iOS开发之NSXMLParserDelegate解析失败
- Linux netstat命令详解
- ndk相关