NSLog(@"found at location = %ld, length = %ld",range.location,range.length);NSLog(@"%@",range);
if ([string containsString:@"."])
{
NSRange range;
range = [string rangeOfString:@"."];
NSLog(@"found at location = %ld, length = %ld",range.location,range.length);
NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:string];
[noteStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:18.0] range:NSMakeRange(2, range.location - 1)];
[self setAttributedText:noteStr];
}
else
{
NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:string];
[noteStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:18.0] range:NSMakeRange(2, [string length] - 2)];
[self setAttributedText:noteStr];
}
发表评论 评论 (0 个评论)