首页 > 其他 > 详细

013-一些开发小技巧

时间:2014-10-17 13:44:24      阅读:197      评论:0      收藏:0      [点我收藏+]

1.动态调整文字大小

NSString *dPriceString  = [NSString stringWithFormat:@"¥%d",model.price]

NSMutableAttributedString *dPrice = [[NSMutableAttributedString alloc] initWithString: dPriceString];
[dPrice addAttribute: NSFontAttributeName value: [UIFont systemFontOfSize: 12] range: NSMakeRange(0, 1)];
[dPrice addAttribute: NSFontAttributeName value: [UIFont systemFontOfSize: 18] range: NSMakeRange(1, dPriceString.length - 1)];
self.labDiscount.attributedText = dPrice;

 

013-一些开发小技巧

原文:http://www.cnblogs.com/lszwhb/p/4030845.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!