Closed iOSleep closed 6 years ago
界面使用 autolayout 布局
// cell - (void)configModel:(ExamQuestionDetail *)model { self.infoLabel.attributedText = nil; for (NSInteger i = 0; i < model.question.models.count; i++) { ExamQuestionModel *one = model.question.models[i]; if (one.type == ExamQuestionModelTypeText) { ExamQuestionTextModel *tmp = (ExamQuestionTextModel *)one; [self.infoLabel appendTextAttributedString:tmp.defaultString]; } } self.infoLabel.paragraphSpacing = ExamQuestionTextParaDefaultHeight; } // view controller - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // ExamPaperModel *paper = self.lv2Array[indexPath.section]; ExamPaperModel *paper = self.lv2Array[2]; ExamQuestionDetail *model = paper.content.question_detail[indexPath.row]; ExamReportTextCell *cell = [tableView dequeueReusableCellWithIdentifier:kTextCell forIndexPath:indexPath]; // 没有其他对 cell 的操作了 [cell configModel:model]; return cell; }
已解决,查看源码发现如果 spcing 相同不会重新结算,在配置的时候先重置此选项。
self.infoLabel.paragraphSpacing = 0;
界面使用 autolayout 布局