iOS富文本——简单应用

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;

你可能感兴趣的:(iOS富文本——简单应用)