码迷,mamicode.com
首页 >  
搜索关键字:nsattributedstring    ( 117个结果
NSMutableAttributedString使用介绍
与NSString类似,在iOS中AttributedString也分为NSAttributedString和NSMutableAttributedString,不同的是,AttributedString对象多了一个Attribute的概念,一个AttributedString的对象包含很多的属性, ...
分类:其他好文   时间:2017-03-27 15:34:18    阅读次数:277
属性字符串的一些使用
1.了解NSAttributedString类 NSDictionary *attributes = @{NSForegroundColorAttributeName: [UIColor redColor],NSFontAttributeName:[UIFont fontWithName:@"Zap ...
分类:其他好文   时间:2017-03-27 15:33:36    阅读次数:140
Swift解析HTML文本
本文只作自用笔记,不喜勿喷,诚谢纠错。 //str为后台获取的html文本,里面包括了字体的颜色和相关属性设置,我们获取到后台数据后用下面的代码进行解析 let attribstr = try! NSAttributedString.init(data:(str?.data(using: Strin ...
分类:编程语言   时间:2017-03-22 13:22:31    阅读次数:661
html文本展示问题
xcode 6.0 以后常用的UILabel UITextView UIWebView 等都支持展示html文本。 当服务器传给你html文本的时候 你调用如下代码 NSAttributedString * attrStr = [[NSAttributedString alloc] initWith ...
分类:Web程序   时间:2017-03-08 13:15:23    阅读次数:252
实现搜索字符与搜索内容突出显示
1.创建可显示的字符集。 @property (nonatomic, copy) NSString *filter; @property (nonatomic, strong) NSAttributedString *merchantShopNameRich; 2.获取到具体的搜索字符。 - (NS ...
分类:其他好文   时间:2017-02-08 12:39:16    阅读次数:232
iOS UIRefreshControl-刷新tableView
override func viewDidLoad() { super.viewDidLoad() refreshControl = UIRefreshControl.init() refreshControl?.attributedTitle = NSAttributedString.init(s ...
分类:移动开发   时间:2016-11-25 17:03:16    阅读次数:240
ioS html的转义
NSString*htmlString=@"<fontcolor=\"#6c6c6c\">快乐每一天,还剩<fontcolor=\"#ff9147\">365天"; NSAttributedString*attributedString=[[NSAttributedStringalloc]initWithData:[htmlStringdataUsingEncoding:NSUTF8StringEncoding]options:@{NSDocumentTypeDocu..
分类:移动开发   时间:2016-11-12 02:29:04    阅读次数:164
textfile 属性
//设置textfile的Placeholder的颜色和字体大小 nameText.attributedPlaceholder = NSAttributedString.init(string: "用户名", attributes: [NSForegroundColorAttributeName: ...
分类:其他好文   时间:2016-11-02 14:01:58    阅读次数:201
iOS--富文本
/** iOS 6之前:CoreText,纯C语言,极其蛋疼 iOS 6开始:NSAttributedString,简单易用 iOS 7开始:TextKit,功能强大,简单易用 * 常用的知...
分类:移动开发   时间:2016-11-02 12:13:18    阅读次数:424
用NSAttributedString实现简单的图文混排
iOS7以后,因为TextKit的强大,可以用NSAttributedString很方便的实现图文混排(主要是利用了NSTextAttachment)。 关于Textkit的牛逼之处,可以参考objcio上的文章(https://objccn.io/issue-5-1/) 我用NSAttribute ...
分类:其他好文   时间:2016-09-10 10:10:59    阅读次数:735
117条   上一页 1 2 3 4 ... 12 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!