NSString属性不起作用?

时间:2015-10-03 10:27:46

标签: ios objective-c nsstring

使用在其他情况下有效的第3种字体,尝试加粗一些文字:

 NSRange boldedRange = NSMakeRange(0, 5);

    NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:timeString];

    [attrString beginEditing];
    [attrString addAttribute:NSFontAttributeName
                       value:[UIFont fontWithName:@"CenturyGothic-Bold" size:[Globals sharedGlobals].16.0+2.0]
                       range:boldedRange];

    [attrString endEditing];


       cell.next.text=[attrString string];

1 个答案:

答案 0 :(得分:0)

解决:

   cell.next.attributedText=attrString;