大佬教程收集整理的这篇文章主要介绍了ios – UITableView自我调整单元格滚动问题,细胞高度差异很大,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
func tableView(tableView: UITableView,cellForRowATindexPath indexPath: NSIndexPath) -> UITableViewCell{ let json = JSON(data: activityTableView.onlineFeedsData)[indexPath.row] // new if(json["topic"]["reply_count"].int > 0){ if let cell: FeedQuestionAnswerTableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier_reply) as? FeedQuestionAnswerTableViewCell{ cell.SELEctionStyle = .None cell.tag = indexPath.row cell.relatedTableView = self.activityTableView cell.configureFeedWithReplyCell(cell,indexPath: indexPath,rect: view.frame,key: "activityTableView") // Make sure the consTraints have been added to this cell,since it may have just been created from scratch cell.layer.shouldRasterize = true cell.layer.rasterizationScale = UIScreen.mainScreen().scale return cell } }else{ if let cell: FeedQuestionTableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as? FeedQuestionTableViewCell{ cell.SELEctionStyle = .None cell.tag = indexPath.row cell.relatedTableView = self.activityTableView cell.configureFeedCell(cell,rect: view.framE) // Make sure the consTraints have been added to this cell,since it may have just been created from scratch cell.layer.shouldRasterize = true cell.layer.rasterizationScale = UIScreen.mainScreen().scale return cell } } return UITableViewCell() }
每个单元格的高度差异为200-400,因此尝试在estimatedHeightForRowATindexPath中实现高度计算.我不能将此方法中的精确估计高度作为计算的bcz
并在willDisplayCell方法中缓存高度,但滚动跳转仍然需要时间来渲染.
单元格就像Facebook卡片类型布局,有很多动态数据,文本和图像可变.可以有人帮助我.谢谢
以上是大佬教程为你收集整理的ios – UITableView自我调整单元格滚动问题,细胞高度差异很大全部内容,希望文章能够帮你解决ios – UITableView自我调整单元格滚动问题,细胞高度差异很大所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。