Skip to content

Commit a2646a3

Browse files
committed
MRPR - 显示错乱的 Bug
1 parent fa9e74b commit a2646a3

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Coding_iOS/Views/Cell/PRMRSearchCell.m

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,20 @@ - (NSAttributedString *)attributeTail{
229229

230230
+ (CGFloat)cellHeightWithObj:(id)obj {
231231
MRPR *mrpr = (MRPR *)obj;
232-
return kBaseCellHeight+[PRMRSearchCell contentLabelHeightWithPRMR:mrpr];
232+
NSString *fromStr, *toStr;
233+
if (mrpr.isMR) {
234+
fromStr = [NSString stringWithFormat:@" %@ ", mrpr.source_branch];
235+
toStr = [NSString stringWithFormat:@" %@ ", mrpr.target_branch];
236+
}else{
237+
fromStr = [NSString stringWithFormat:@" %@ : %@ ", mrpr.author.name, mrpr.source_branch];
238+
toStr = [NSString stringWithFormat:@" %@ : %@ ", mrpr.des_owner_name, mrpr.target_branch];
239+
}
240+
241+
NSString *totalStr = [NSString stringWithFormat:@"%@%@", fromStr, toStr];
242+
243+
float offset= ([totalStr getWidthWithFont:[UIFont systemFontOfSize:12] constrainedToSize:CGSizeMake(CGFLOAT_MAX, 20)] + 40 > kScreen_Width - 2*kPaddingLeftWidth)?(15+20):0;
244+
245+
return kBaseCellHeight+[PRMRSearchCell contentLabelHeightWithPRMR:mrpr]+offset;
233246
}
234247

235248
+ (CGFloat)contentLabelHeightWithPRMR:(MRPR *)curMRPR{

0 commit comments

Comments
 (0)