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, indexPath: indexPath, 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
.मैं में ऊंचाई गणना को लागू करने की कोशिश की गणना के बीसीजेUITableView सेल ऊंचाई के बड़े अंतर के साथ स्वयं आकार सेल स्क्रॉल मुद्दों
और willDisplayCell
विधि में ऊंचाई को कैशिंग करना अभी भी स्क्रॉल कूदता है जैसे इसे प्रतिपादन करने में समय लगता है।
सेल चर ऊंचाई पाठ और images.Can कोई मेरी मदद इस धन्यवाद में
तुम मुझे कैसे 'tableView (में सेल की ऊंचाई की गणना करने के बारे में और अधिक बता सकते हैं _ : estimatedHeightForRowAtIndexPath:) '? –