// 在UILabel上显示文字和图片
//UIlabel 富文本 字体显示不同颜色
UILabel *testLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 100, 320, 30)];
testLabel.backgroundColor = [UIColor lightGrayColor];
testLabel.textAlignment = NSTextAlignmentCenter;
NSMutableAttributedString *AttributedStr = [[NSMutableAttributedString alloc] initWithString:@"今天天气不错呀"];
[AttributedStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:20.0] range:NSMakeRange(2, 2)];
[AttributedStr addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(2, 3)];
testLabel.attributedText = AttributedStr;
[self.view addSubview:testLabel];
//UIlabel 富文本 图文混排
UILabel *testLabel_2 =[[UILabel alloc]init];
testLabel_2.frame =CGRectMake(0, 100+50, 200, 100);
testLabel_2.backgroundColor =[UICo
//UIlabel 富文本 字体显示不同颜色
UILabel *testLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 100, 320, 30)];
testLabel.backgroundColor = [UIColor lightGrayColor];
testLabel.textAlignment = NSTextAlignmentCenter;
NSMutableAttributedString *AttributedStr = [[NSMutableAttributedString alloc] initWithString:@"今天天气不错呀"];
[AttributedStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:20.0] range:NSMakeRange(2, 2)];
[AttributedStr addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(2, 3)];
testLabel.attributedText = AttributedStr;
[self.view addSubview:testLabel];
//UIlabel 富文本 图文混排
UILabel *testLabel_2 =[[UILabel alloc]init];
testLabel_2.frame =CGRectMake(0, 100+50, 200, 100);
testLabel_2.backgroundColor =[UICo