设置属性字体
来源:互联网 发布:淘宝金牌店铺可信吗 编辑:程序博客网 时间:2024/05/18 02:43
/**
* 设置属性字体
*
* @param elementString 需要设置的文字
* @param i 后数第几个位置停止设置
*
* @return 设置好的文字
*/
- (NSMutableAttributedString *) attributedString:(NSString *)elementString lastTextIndex:(int) i
{
NSString * str = elementString;
NSMutableAttributedString * attr = [[NSMutableAttributedStringalloc]initWithString:str];
// 设置金额字体和颜色
[attr addAttribute:NSFontAttributeNamevalue:[UIFontsystemFontOfSize:15]range:NSMakeRange(0, str.length-i)];
// 设置单位字体和颜色
[attr addAttribute:NSFontAttributeNamevalue:[UIFontsystemFontOfSize:11]range:NSMakeRange(str.length-i, i)];
[attr addAttribute:NSForegroundColorAttributeNamevalue:UIColorFromRGBValue(0x323232)range:NSMakeRange(str.length-i, i)];
return attr;
}
- AttributedString设置字体属性
- 设置字体属性
- 设置属性字体
- pain设置字体属性
- 设置控件的字体属性
- C#设置textBox字体属性
- IOS-UI设置字体属性
- Android 设置字体加粗属性
- css字体设置相关属性
- HTML标记【字体的属性设置】!
- Android中Paint字体属性的设置
- Qt 设置字体 字号等格式属性
- Android中Paint字体属性的设置
- Android中Paint字体属性的设置
- Android中Paint字体属性的设置
- static控件设置字体与透明属性
- Android中Paint字体属性的设置
- Android中Paint字体属性的设置
- Android全面的网络工具方法
- 验证码的生成
- IO流
- C语言程序初体验-第十九课-字符数据及字符类型
- hdu1394(最小逆序数)(线段树单点更新)
- 设置属性字体
- Acitivity和View组件介绍
- 5.14
- 简单描述JSON跟JSONP的区别以及实战
- SCU 4526 最短路
- c50
- Android面试题(一)
- 生产环境的开源容器管理平台--Rancher入门教程(3): Certified Catalog
- SeqList