chang color of some characters in a string
来源:互联网 发布:外文数据库哪个好 编辑:程序博客网 时间:2024/06/06 19:25
//先把这个string取出来,转化一下属性
NSMutableAttributedString *str = [[NSMutableAttributedStringalloc] initWithString:_interstnumLabel.text];
//建立字典
NSDictionary *dict = [[NSDictionaryalloc] initWithObjectsAndKeys:[UIColoryellowColor],NSForegroundColorAttributeName,nil];
//调用改变属性方法
[str setAttributes:dictrange:NSMakeRange(0,2)];
//重新赋给源本
_interstnumLabel.attributedText = str;
0 0
- chang color of some characters in a string
- A collection of color schemes for some famous websites in China
- Unique Characters of a String
- 【3】Remove the duplicate characters in a string
- [CrackCode] 1.3 Remove the duplicate characters in a string
- Find common characters in a set of strings
- A string s is LUCKY if and only if the number of different characters in s is a fibonacci number. Gi
- bytes of a string in java?
- 434. Number of Segments in a String
- 434. Number of Segments in a String
- Leetcode434. Number of Segments in a String
- Number of Segments in a String
- 434. Number of Segments in a String*
- 434. Number of Segments in a String
- Leetcode Number of Segments in a String
- 434. Number of Segments in a String
- LEETCODE--Number of Segments in a String
- 20170223-LeetCode_434_Number of Segments in a String
- Android消息推送完美方案
- 增加页面左上角图标
- YTU-OJ-类---矩形类
- 快船和火箭抢七比赛分析。
- [LeetCode]Copy List with Random Pointer
- chang color of some characters in a string
- YTU-OJ-类中私有成员的访问
- 混个积分
- linux 技巧:使用 screen 管理你的远程会话
- zookeeper和java实现的统一配置管理和集群节点管理简单案例
- 质数
- android自动化测试--编译、生成jar文件,push到手机
- Tomcat 配置 以及一台电脑同时配置上同时配置多个Tomcat
- android之Notification通知