更新时间:2022-09-24 11:30:58
【持续更新中】
原文:
iOS开发效率工具:完整SDK源码【封装富文本API,采用block实现链式编程】(block 的妙用:结合block和方法的优点实现iOS的链式编程)
1、文章:https://blog.csdn.net/z929118967/article/details/107835195 2、从CSDN资源下载完整SDK代码:https://download.csdn.net/download/u011018979/14038715
NSMutableAttributedString *xx = [[NSMutableAttributedString alloc]init]; xx.kn_addString(@"封装富文本API").kn_fontColor(UIColor.redColor).kn_addString(@"采用block实现链式编程").kn_fontColor(UIColor.blueColor).kn_addString(@"!");
1、文章:https://blog.csdn.net/z929118967/article/details/103902362 2、从csdn资源下载demo源码:https://download.csdn.net/download/u011018979/140267733、效果
4《用户协议及隐私政策》 弹框的实现步骤: 4.1、自定义TextView,采用富文本属性进行内容设置attributedText(包括下划线NSUnderlineStyleSingle、超链接NSLinkAttributeName 、颜色NSForegroundColorAttributeName 等信息) 4.2、实现代理方法textView:shouldInteractWithURL:inRange,处理点击超链接的回调(打开对应URL Webview)
使用 NSMutableAttributedString 富文本attributedPlaceholder来替代KVC访问 UITextField 的 _placeholderLabel。
+ (void)setupUITextField4attributedPlaceholder:(UITextField*)textField{ textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"placeholder" attributes:@{NSForegroundColorAttributeName:kTextPlaceholderColor, NSFontAttributeName:kTextFont(13) }]; }