iOS富文本——简单应用
2016-11-22 本文已影响11人
lizhi_boy
NSMutableDictionary*dic = [NSMutableDictionary dictionary];
dic[NSForegroundColorAttributeName] = [UIColorlight GrayColor];//字体颜色
dic[NSFontAttributeName] = [UIFont systemFontOfSize:12];//字体大小
NSMutableAttributedString *att = [[NSMutableAttributedString alloc] initWithString:@"(未设定)" attributes:dic];//内容
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0,80,90)];//自定的UILabel
myLabel.attributedText = att;