YYText是强大的YYKit的一部分可以单独下载
Powerful text framework for iOS to display and edit rich text. (It's a component ofYYKit)
集成的时候建议使用cocopod管理
1.里面主要两个控件:
YYTextView 和 YYLabel
现在主要是YYTextview的简单使用
YYText主要是NSMutableAttributedString来处理富文本 他的内部实现可以自己去深究。
简单的图文并排,使用NSMutableAttributedString创建一个对象 然后 appendAttributesString来拼接文字和图片(占位)
直接上代码:
//
// TextAndImageTextViewVC.h
// YYTextDemo
//
// Created by linpeng on 16/3/13.
// Copyright © 2016年 ibireme. All rights reserved.
//
#import
@interface TextAndImageTextViewVC : UIViewController
@end
//
// TextAndImageTextViewVC.m
// YYTextDemo
//
// Created by linpeng on 16/3/13.
// Copyright © 2016年 ibireme. All rights reserved.
//
#import "TextAndImageTe