Tag: detailtext标签

IOS多个左右alignment在同一行上

我想写在我的tableview单元格detailTextLabel的同一行。 例如Left string right string 。 我正在这样做: NSMutableAttributedString *descriptionAttribute = [[NSMutableAttributedString alloc] initWithString:descriptionString]; NSMutableAttributedString *dateAttribute = [[NSMutableAttributedString alloc] initWithString:finalDate]; NSMutableAttributedString *shareAttribute = [[NSMutableAttributedString alloc] initWithString:@"Share"]; NSMutableParagraphStyle *dateStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [dateStyle setAlignment:NSTextAlignmentLeft]; NSMutableParagraphStyle *shareStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [shareStyle setAlignment:NSTextAlignmentRight]; [dateAttribute addAttribute:NSForegroundColorAttributeName value:[UIColor grayColor] range:NSMakeRange(0, 13)]; [dateAttribute addAttribute:NSParagraphStyleAttributeName value:dateStyle range:NSMakeRange(0, 13)]; [shareAttribute addAttribute:NSForegroundColorAttributeName value:[UIColor […]