iOS自己总结的超级详细分解富文本大全(AttributedString),图文混排很轻松
转载于 http://blog.csdn/deft_mkjing/article/details/52141936
NSFontAttributeName 设置字体大小和字体的类型 默认12Helvetica(Neue)
NSForegroundColorAttributeName 设置字体颜色,默认黑色 UIColor对象
NSBackgroundColorAttributeName 设置字体所在区域的背景颜色,默认为nil,透明色
NSLigatureAttributeName 设置连体属性,NSNumber对象 默认0没有连体
NSKernAttributeName 设置字符间距, NSNumber浮点型属性 正数间距加大,负数间距缩小
NSStrikethroughStyleAttributeName 设置删除线,NSNumber对象
NSStrikethroughColorAttributeName 设置删除线颜色,UIColor对象,默认是黑色
NSUnderlineStyleAttributeName 设置下划线,NSNumber对象 NSUnderlineStyle枚举值
NSUnderlineColorAttributeName 设置下划线颜色,UIColor对象,默认是黑色
NSStrokeWidthAttributeName 设置笔画宽度,NSNumber对象 正数中空 负数填充
NSStrokeColorAttributeName 设置填充部分颜色,不是指字体颜色,UIColor对象
NSShadowAttributeName 设置阴影属性,取值为NSShadow对象
NSTextEffectAttributeName 设置文本特殊效果 NSString对象 只有图版印刷效果可用
NSBaselineOffsetAttributeName 设置基线偏移量,NSNumberfloat对象 正数向上偏移,负数向下偏移
NSObliquenessAttributeName 设置字体倾斜度,NSNumberfloat对象,正数右倾斜,负数左倾斜
NSExpansionAttributeName 设置文本横向拉伸属性,NSNumberfloat对象,正数横向拉伸文本,负数压缩
NSWritingDirectionAttributeName 设置文字书写方向,从左向右或者右向左
NSVerticalGlyphFormAttributeName 设置文本排版方向,NSNumber对象。0横向排版,1竖向排版
NSLinkAttributeName 设置文本超链接,点击可以打开指定URL地址
NSAttachmentAttributeName 设置文本附件,取值为NSTextAttachment对象,一般为图文混排
NSParagraphStyleAttributeName 设置文本段落排版,为NSParagraphStyle对象
道来,每个属性一行,分分钟教大家简单学习富文本
1.NSFontAttributeName
说明:该属性用于改变一段文本的字体。如果不指定该属性,则默认为12-point Helvetica(Neue)
2.NSForegroundColorAttributeName
说明:该属性用于指定一段文本的字体颜色。如果不指定该属性,则默认为黑色
3.NSBackgroundColorAttributeName
说明:设置文字背景颜色
NSString*string =@"落霞与孤鹜齐飞,秋水共长天一色";
NSMutableAttributedString*mutableAttriteStr = [[NSMutableAttributedStringalloc]init];
NSAttributedString*attributeStr1= [[NSAttributedStringalloc]initWithString:[stringsubstringWithRange:NSMakeRange(0,3)]attributes:@{NSFontAttributeName :[UIFontfontWithName:@"futura"size:12],NSForegroundColorAttributeName : [UIColorredColor],NSBackgroundColorAttributeName : [UIColoryellowColor]}];
NSAttributedString*attributeStr4= [[NSAttributedStringalloc]initWithString:[stringsubstringWithRange:NSMakeRange(3,4)]attributes:@{NSFontAttributeName :[UIFontfontWithName:@"futura"size:22],NSForegroundColorAttributeName : [UIColorredColor],NSBackgroundColorAttributeName : [UIColoryellowColor]}];
NSAttributedString*attributeStr2= [[NSAttributedStringalloc]initWithString:[stringsubstringWithRange:NSMakeRange(8,4)]attributes:@{NSFontAttributeName : [UIFontboldSystemFontOfSize:22],NSForegroundColorAttributeName : [UIColorblackColor],NSBackgroundColorAttributeName : [UIColorlightGrayColor]}];
NSAttributedString*attributeStr5= [[NSAttributedStringalloc]initWithString:[stringsubstringWithRange:NSMakeRange(12,3)]attributes:@{NSFontAttributeName : [UIFontboldSystemFontOfSize:12],NSForegroundColorAttributeName : [UIColorblackColor],NSBackgroundColorAttributeName : [UIColorlightGrayColor]}];
NSAttributedString*attriteStr3= [[NSAttributedStringalloc]initWithString:[stringsubstringWithRange:NSMakeRange(7,1)]attributes:@{NSBackgroundColorAttributeName : [UIColorgreenColor]}];
[mutableAttriteStrappendAttributedString:attributeStr1];
[mutableAttriteStrappendAttributedString:attributeStr4];
[mutableAttriteStrappendAttributedString:attriteStr3];
[mutableAttriteStrappendAttributedString:attributeStr2];
[mutableAttriteStrappendAttributedString:attributeStr5];
self.label1.attributedText= mutableAttriteStr;
4.NSLigatureAttributeName
连体字符是指某些连在一起的字符,它们采用单个的图元符号。0 表示没有连体字符。1
表示使用默认的连体字符。2表示使用所有连体符号。默认值为 1(注意,iOS不支持值
为 2)
// 连体艺术字,不是每个都能连起的,f和l f和i就可以,其他各位可以自己去试试
self.label2.attributedText= [[NSAttributedStringalloc]initWithString:@"flush and fily"attributes:@{NSLigatureAttributeName : [NSNumbernumberWithInt:1],NSFontAttributeName : [UIFontfontWithName:@"futura"size:30]}];
NSMutableAttributedString*mutableAttributeStr2= [[NSMutableAttributedStringalloc]init];
NSAttributedString*string6= [[NSAttributedStringalloc]initWithString:@"ABCDE "attributes:@{NSKernAttributeName : [NSNumbernumberWithInt:-3],NSForegroundColorAttributeName : [UIColorredColor]}];
NSAttributedString*string7= [[NSAttributedStringalloc]initWithString:@"FGHIJ "attributes:@{NSKernAttributeName : [NSNumbernumberWithInt:0],NSForegroundColorAttributeName : [UIColoryellowColor]}];
NSAttributedString*string8= [[NSAttributedStringalloc]initWithString:@"KLMNO "attributes:@{NSKernAttributeName : @(15),NSForegroundColorAttributeName : [UIColorblueColor]}];
[mutableAttributeStr2appendAttributedString:string6];
[mutableAttributeStr2appendAttributedString:string7];
[mutableAttributeStr2appendAttributedString:string8];
self.label3.attributedText= mutableAttributeStr2;
5.NSKernAttributeName
字符间距正值间距加宽,负值间距变窄
[objc]view plaincopy
NSMutableAttributedString*mutableAttributeStr2= [[NSMutableAttributedStringalloc]init];
NSAttributedString*string6= [[NSAttributedStringalloc]initWithString:@"ABCDE "attributes:@{NSKernAttributeName : [NSNumbernumberWithInt:-3],NSForegroundColorAttributeName : [UIColorredColor]}];
NSAttributedString*string7= [[NSAttributedStringalloc]initWithString:@"FGHIJ "attributes:@{NSKernAttributeName : [NSNumbernumberWithInt:0],NSForegroundColorAttributeName : [UIColoryellowColor]}];
NSAttributedString*string8= [[NSAttributedStringalloc]initWithString:@"KLMNO "attributes:@{NSKernAttributeName : @(15),NSForegroundColorAttributeName : [UIColorblueColor]}];
[mutableAttributeStr2appendAttributedString:string6];
[mutableAttributeStr2appendAttributedString:string7];
[mutableAttributeStr2appendAttributedString:string8];
self.label3.attributedText= mutableAttributeStr2;
6.NSStrikethroughStyleAttributeName 和 NSStrikethroughColorAttributeName
NSStrikethroughStyleAttributeName 设置删除线,取值为 NSNumber 对象(整数),
NSStrikethroughColorAttributeName 设置删除线颜色
枚举常量 NSUnderlineStyle中的值:
NSUnderlineStyleNone =0x00, 不设置
NSUnderlineStyleSingle =0x01, 设置单细删除线
NSUnderlineStyleThickNS_ENUM_AVAILABLE(10_0,7_0) =0x02, 设置粗单删除线
NSUnderlineStyleDoubleNS_ENUM_AVAILABLE(10_0,7_0) =0x09,双细删除线
[objc]view plaincopy
NSMutableAttributedString*mutableAttributeStr3= [[NSMutableAttributedStringalloc]init];
NSAttributedString*string9= [[NSAttributedStringalloc]initWithString:@"只要998 "attributes:@{NSStrikethroughStyleAttributeName : @(NSUnderlineStyleSingle),NSStrikethroughColorAttributeName : [UIColorredColor]}];
NSAttributedString*string10= [[NSAttributedStringalloc]initWithString:@"真的998 "attributes:@{NSStrikethroughStyleAttributeName : @(NSUnderlineStyleThick),NSStrikethroughColorAttributeName : [UIColorblueColor]}];
NSAttributedString*string11= [[NSAttributedStringalloc]initWithString:@"好吧9块拿走"attributes:@{NSStrikethroughStyleAttributeName : @(NSUnderlineStyleDouble),NSStrikethroughColorAttributeName : [UIColoryellowColor]}];
[mutableAttributeStr3appendAttributedString:string9];
[mutableAttributeStr3appendAttributedString:string10];
[mutableAttributeStr3appendAttributedString:string11];
self.label4.attributedText= mutableAttributeStr3;
7.NSUnderlineStyleAttributeName 和
NSUnderlineColorAttributeName
给文字加下划线和更换下划线颜色,属性和上面的删除线都是一样用的
[objc]view plaincopy
NSMutableAttributedString*mutableAttributeStr4= [[NSMutableAttributedStringalloc]init];
NSAttributedString*string12= [[NSAttributedStringalloc]initWithString:@"只要888 "attributes:@{NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle),NSUnderlineColorAttributeName : [UIColorredColor]}];
NSAttributedString*string13= [[NSAttributedStringalloc]initWithString:@"真的88 "attributes:@{NSUnderlineStyleAttributeName : @(NSUnderlineStyleThick),NSUnderlineColorAttributeName : [UIColorpurpleColor]}];
NSAttributedString*string14= [[NSAttributedStringalloc]initWithString:@"好吧8块拿走"attributes:@{NSUnderlineStyleAttributeName : @(NSUnderlineStyleDouble),NSUnderlineColorAttributeName : [UIColoryellowColor]}];
[mutableAttributeStr4appendAttributedString:string12];
[mutableAttributeStr4appendAttributedString:string13];
[mutableAttributeStr4appendAttributedString:string14];
self.label5.attributedText= mutableAttributeStr4;
8.NSStrokeWidthAttributeName 和NSStrokeColorAttributeName
设置文字描边颜色,需要和NSStrokeWidthAttributeName设置描边宽度,这样就能使文字空心.
NSStrokeWidthAttributeName 这个属性所对应的值是一个 NSNumber 对象(小数)。该值改变笔画宽度(相对于字体 size 的百分比),负值填充效果,正值中空效果,默认为 0,即不改变。正数只改变描边宽度。负数同时改变文字的描边和填充宽度。例如,对于常见的空心字,这个值通常为 3.0。
同时设置了空心的两个属性,并且 NSStrokeWidthAttributeName 属性设置为整数,文字前景色就无效果了
[objc]view plaincopy
NSMutableAttributedString*mutableAttributeStr5= [[NSMutableAttributedStringalloc]init];
// 如果这个stroke的width正数的时候,字体就中空了,那么前景色就设置无效了
NSAttributedString*string15= [[NSAttributedStringalloc]initWithString:@"HELLO "attributes:@{NSStrokeWidthAttributeName : @(5),NSStrokeColorAttributeName : [UIColoryellowColor],NSFontAttributeName : [UIFontboldSystemFontOfSize:30],NSForegroundColorAttributeName : [UIColorredColor]}];
NSAttributedString*string16= [[NSAttributedStringalloc]initWithString:@"YUKD "attributes:@{NSStrokeWidthAttributeName : @(0),NSStrokeColorAttributeName : [UIColorredColor],NSFontAttributeName : [UIFontboldSystemFontOfSize:30]}];
NSAttributedString*string17= [[NSAttributedStringalloc]initWithString:@"GOOGLE"attributes:@{NSStrokeWidthAttributeName : @(-5),NSStrokeColorAttributeName : [UIColorgreenColor],NSFontAttributeName : [UIFontboldSystemFontOfSize:30],NSForegroundColorAttributeName : [UIColorlightGrayColor]}];
[mutableAttributeStr5appendAttributedString:string15];
[mutableAttributeStr5appendAttributedString:string16];
[mutableAttributeStr5appendAttributedString:string17];
self.label6.attributedText= mutableAttributeStr5;
9.NSShadowAttributeName
设置文字阴影,取值为NSShadow对象
[objc]view plaincopy
// 设置阴影
NSShadow*shadow = [[NSShadowalloc]init];
shadow.shadowBlurRadius=5.0f;// 模糊度
shadow.shadowColor= [UIColorblueColor];
shadow.shadowOffset= CGSizeMake(1,5);
NSAttributedString*string20= [[NSAttributedStringalloc]initWithString:@"HELLO_HALY_璟"attributes:@{NSFontAttributeName : [UIFontboldSystemFontOfSize:30],NSForegroundColorAttributeName : [UIColorredColor],NSShadowAttributeName : shadow}];
self.label7.attributedText= string20;
10.NSTextEffectAttributeNam
NSTextEffectAttributeName //设置文本特殊效果,取值为NSString类型,目前只有一个可用效果 NSTextEffectLetterpressStyle(凸版印刷效果)
[objc]view plaincopy
// 文本印刷,我也不知道是什么鬼
// 设置阴影
NSAttributedString*string21= [[NSAttributedStringalloc]initWithString:@"HELLO_HALY_璟"attributes:@{NSFontAttributeName : [UIFontboldSystemFontOfSize:30],NSForegroundColorAttributeName : [UIColorredColor],NSShadowAttributeName : shadow,NSTextEffectAttributeName : NSTextEffectLetterpressStyle}];
self.label8.attributedText= string21;
11.NSBaselineOffsetAttributeName
文字基线偏移,想要达到以下图片的效果,就要设置需要的文字偏移,正数上移,负数下
移
[objc]view plaincopy
// 设置文本的基线 负数向下 正数向上 0不变
UIFont*bigFont = [UIFontboldSystemFontOfSize:36];
UIFont*smallFont = [UIFontboldSystemFontOfSize:bigFont.pointSize/2];
CGFloat capHeight = bigFont.pointSize- smallFont.pointSize;
NSMutableAttributedString*attributeString6= [[NSMutableAttributedStringalloc]init];
NSAttributedString*string22= [[NSAttributedStringalloc]initWithString:@"¥"attributes:@{NSFontAttributeName : smallFont,NSForegroundColorAttributeName : [UIColorblackColor],NSBaselineOffsetAttributeName : @(0)}];
NSAttributedString*string23= [[NSAttributedStringalloc]initWithString:@"9"attributes:@{NSFontAttributeName : bigFont,NSForegroundColorAttributeName : [UIColorblueColor],NSBaselineOffsetAttributeName : @(0)}];
NSAttributedString*string24= [[NSAttributedStringalloc]initWithString:@".99"attributes:@{NSFontAttributeName : smallFont,NSForegroundColorAttributeName : [UIColorblackColor],NSBaselineOffsetAttributeName : @(0)}];
NSAttributedString*string28= [[NSAttributedStringalloc]initWithString:@" 七夕大促销 "attributes:@{NSFontAttributeName : [UIFontboldSystemFontOfSize:24],NSForegroundColorAttributeName : [UIColorblackColor],NSBaselineOffsetAttributeName : @(0),NSShadowAttributeName : shadow}];
NSAttributedString*string25= [[NSAttributedStringalloc]initWithString:@"¥"attributes:@{NSFontAttributeName : smallFont,NSForegroundColorAttributeName : [UIColorblackColor],NSBaselineOffsetAttributeName : @(capHeight -5)}];
NSAttributedString*string26= [[NSAttributedStringalloc]initWithString:@"0"attributes:@{NSFontAttributeName : bigFont,NSForegroundColorAttributeName : [UIColorredColor],NSBaselineOffsetAttributeName : @(0)}];
NSAttributedString*string27= [[NSAttributedStringalloc]initWithString:@".09"attributes:@{NSFontAttributeName : smallFont,NSForegroundColorAttributeName : [UIColorblackColor],NSBaselineOffsetAttributeName : @(capHeight -5)}];
[attributeString6appendAttributedString:string22];
[attributeString6appendAttributedString:string23];
[attributeString6appendAttributedString:string24];
[attributeString6appendAttributedString:string28];
[attributeString6appendAttributedString:string25];
[attributeString6appendAttributedString:string26];
[attributeString6appendAttributedString:string27];
self.label9.attributedText= attributeString6;
NSMutableAttributedString*attributeString7= [[NSMutableAttributedStringalloc]init];
NSAttributedString*string29= [[NSAttributedStringalloc]initWithString:@"Hello "attributes:@{NSFontAttributeName : [UIFontboldSystemFontOfSize:40],NSForegroundColorAttributeName : [UIColorblackColor],NSBaselineOffsetAttributeName : @(0)}];
NSAttributedString*string30= [[NSAttributedStringalloc]initWithString:@" World "attributes:@{NSFontAttributeName : [UIFontboldSystemFontOfSize:20],NSForegroundColorAttributeName : [UIColorblackColor],NSBaselineOffsetAttributeName : @(0)}];
NSAttributedString*string31= [[NSAttributedStringalloc]initWithString:@"Hello "attributes:@{NSFontAttributeName : [UIFontboldSystemFontOfSize:40],NSForegroundColorAttributeName : [UIColorblackColor],NSBaselineOffsetAttributeName : @(0)}];
NSAttributedString*string32= [[NSAttributedStringalloc]initWithString:@" World"attributes:@{NSFontAttributeName : [UIFontboldSystemFontOfSize:20],NSForegroundColorAttributeName : [UIColorblackColor],NSBaselineOffsetAttributeName : @(6)}];
[attributeString7appendAttributedString:string29];
[attributeString7appendAttributedString:string30];
[attributeString7appendAttributedString:string31];
[attributeString7appendAttributedString:string32];
self.label10.attributedText= attributeString7;
12.NSObliquenessAttributeName
NSObliquenessAttributeName 设置字体倾斜度,取值为 NSNumber(float),正值右倾,负值左倾
13.NSExpansionAttributeName
NSExpansionAttributeName 设置字体的横向拉伸,取值为NSNumber (float),正值拉伸 ,负值压缩
14.NSVerticalGlyphFormAttributeName
NSVerticalGlyphFormAttributeName 设置文字排版方向,取值为NSNumber对象(整数),0表示横排文本,1表示竖排文本 在ios中只支持0
[objc]view plaincopy
// 说明:NSVerticalGlyphFormAttributeName 设置文字排版方向,取值为NSNumber对象(整数),0表示横排文本,1表示竖排文本 在iOS中只支持0
//说明:NSObliquenessAttributeName 设置字体倾斜度,取值为 NSNumber(float),正值右倾,负值左倾
// NSExpansionAttributeName
// 说明:NSExpansionAttributeName 设置字体的横向拉伸,取值为NSNumber (float),正值拉伸 ,负值压缩
NSMutableAttributedString*mutableAttriteStr = [[NSMutableAttributedStringalloc]init];
NSAttributedString*attributeStr1= [[NSAttributedStringalloc]initWithString:@"HeHe_XiXi_mm"attributes:@{NSFontAttributeName :[UIFontboldSystemFontOfSize:30],NSForegroundColorAttributeName : [UIColorredColor],NSShadowAttributeName : shadow,NSObliquenessAttributeName : @(1),NSExpansionAttributeName : @(1),NSVerticalGlyphFormAttributeName : @(1)}];
[mutableAttriteStrappendAttributedString:attributeStr1];
self.label1.attributedText= mutableAttriteStr;
15.NSWritingDirectionAttributeName
文字书写方向取值为以下组合为例 他是一个数组包含NSNumber 一般书写就是L ---R
那么我们多个需求也就是从R --- L
The values of theNSNumberobjects should be0,1,2, or3, forLRE,RLE,LRO, orRLOrespectively, and combinations ofleftToRightandrightToLeftwithNSTextWritingDirectionEmbeddingorNSTextWritingDirectionOverride
[objc]view plaincopy
// 文字书写方向
// The values of the NSNumber objects should be 0, 1, 2, or 3, for LRE, RLE, LRO, or RLO respectively, and combinations of leftToRight and rightToLeft with NSTextWritingDirectionEmbedding or NSTextWritingDirectionOverride, as shown in Table 1.
// NSWritingDirectionLeftToRight | NSTextWritingDirectionEmbedding
// NSWritingDirectionRightToLeft | NSTextWritingDirectionEmbedding
// NSWritingDirectionLeftToRight | NSTextWritingDirectionOverride
// NSWritingDirectionRightToLeft | NSTextWritingDirectionOverride
NSMutableAttributedString*attributuStr2= [[NSMutableAttributedStringalloc]init];
NSAttributedString*string1= [[NSAttributedStringalloc]initWithString:@"一切皆有可能"attributes:@{NSFontAttributeName : [UIFontboldSystemFontOfSize:24],NSForegroundColorAttributeName : [UIColorredColor],NSWritingDirectionAttributeName : @[@(3)]}];
[attributuStr2appendAttributedString:string1];
self.label.attributedText= attributuStr2;
16.NSLinkAttributeName
这货有点奇葩,所以很多人用第三方例如YYLabel来做,这东西不能在UILabel和UITextField使用,只能用UITextView来进行,实现他的代理,在代理方法里面进行URL跳转
- (BOOL)textView:(UITextView*)textView shouldInteractWithURL:(NSURL*)URL inRange:(NSRange)characterRange
该方法返回YES就能打开URL,NO不做任何事情
注:
1.一定要实现UITextView的代理才能进行URL跳转
2.textView的editable属性修改为NO,在编辑时不可点击
[objc]view plaincopy
// 把 NSLinkAttributeName 属性单独列出来,是因为在 UILabel 和 UITextField 中是无法使用该属性的。更准确点说是在UILabel 和 UITextField 中无法实现点击链接启动浏览器打开一个URL地址,因为在此过程中用到了一个代理函数。只能用在 UITextView 中
self.textView.delegate=self;
self.textView.scrollEnabled=NO;
self.textView.editable=NO;
self.textView.textContainer.lineFragmentPadding=0;
self.textView.textContainerInset= UIEdgeInsetsMake(0,0,0,0);
NSString*str =@" 跳转到宓珂璟的博客";
NSMutableAttributedString*attrStr = [[NSMutableAttributedStringalloc]initWithString:str];
[attrStraddAttribute:NSLinkAttributeNamevalue:[NSURLURLWithString:@"http://blog.csdn.net/deft_mkjing"]range:[strrangeOfString:@"宓珂璟的博客"]];
[attrStraddAttribute:NSFontAttributeNamevalue:[UIFontboldSystemFontOfSize:30]range:NSMakeRange(0, str.length)];
self.textView.attributedText= attrStr;
17.NSTextAttachment
设置文本附件,取值为NSTextAttachment对象 常用于图文混排
[objc]view plaincopy
NSString*words =@"天才";
NSMutableAttributedString*strAtt = [[NSMutableAttributedStringalloc]initWithString:wordsattributes:@{NSFontAttributeName : [UIFontboldSystemFontOfSize:25]}];
NSTextAttachment*attatch = [[NSTextAttachmentalloc]initWithData:nilofType:nil];
attatch.bounds= CGRectMake(0,0,40,30);
attatch.image= [UIImageimageNamed:@"$DCZ2WLN9RWI6JF(Q`P_(NH.jpg"];
NSTextAttachment*attatch1= [[NSTextAttachmentalloc]initWithData:nilofType:nil];
attatch1.bounds= CGRectMake(0,0,50,30);
attatch1.image= [UIImageimageNamed:@"%5T@J(4WKWSOX2~~PY0{4M0.jpg"];
NSAttributedString*string8= [NSAttributedStringattributedStringWithAttachment:attatch];
NSAttributedString*string9= [NSAttributedStringattributedStringWithAttachment:attatch1];
[strAttinsertAttributedString:string8atIndex:1];
[strAttinsertAttributedString:string9atIndex:0];
self.label3.attributedText= strAtt;
基本的就介绍到这里了,上面那些已经足够用了,而且可以任意组合出想要的图文混排,
如果遇到特殊的需求或者不能满足的,那么就需要各位去试试往上的第三方富文本了
给个好用的大家可以试试点击打开链接
本次Demo地址:Demo传送门
Demo里面貌似没有注释掉多余的属性列表,大家要看的自行注释一下
谢谢大家阅读,记录的同时希望能帮到大家!!!
顶
•图文混排
•实现图文混排ListView展示 ---- Android版
•iOS图文混排(需要在文本或者字符串中某些特定位置添加文本框)
•小胖说事13--------NSTextAttachment富文本控件实现图文混排
猜你在找
IT(6)
ios(216)
人工智能(1)
服务器(7)
android 安全(9)
android 测试工具(12)
android崩溃(4)
c语言(1)
产品(15)
外贸(1)
IOS异常(2)
PS(1)
基础算法+基础知识总结(13)
设计模式(1)
Job(19)
文章存档
2017年06月(2)
2017年05月(4)
2017年04月(9)
2017年03月(16)
2017年02月(11)
展开
阅读排行
RecyclerView setHasFixedSize(true); 的作用(14385)
Android自定义View进阶 - 贝塞尔曲线(4479)
把Android手机变成远程监控摄像头(3394)
GLIDE 的 一些用法(2971)
51个赚钱最好的方法(史上最全攻略)(2919)
TabLayout:另一种Tab的实现方式(2890)
eclipse转android studio常遇到的问题(2011)
安卓7.1 新特性Shortcut(1795)
ViewCompat.animate 动画实现方式(1780)
通过代码 新增 和 “修改”NSLayoutConstraint(1625)
评论排行
Android 基于google Zxing实现二维码、条形码扫描,仿微信二维码扫描效果(1)
Android性能优化 view.setLayerType(View.LAYER_TYPE_NONE, null); 来优化Property动画(1)
drawLine DashPathEffect绘制虚线变成了实线(1)
Android 向右滑动销毁(finish)Activity, 随着手势的滑动而滑动的效果(1)
最新评论
Android NDK——使用Android Studio引用so库,jar包及module并使用JNI的正确姿势
qq_38354031: 我来顶一个
孙华强: CSDN博友你好,我是孙华强,现将此篇博文收录进“Android知识库”。CSDN现在在做CSDN博...
Android性能优化 view.setLayerType(View.LAYER_TYPE_NONE, null); 来优化Property动画
Boiling_Cola: 可以转吗?
renzhengjigou: 仔细看了一遍,收获很大。
renzhengjigou: 仔细看了一遍,收获很大。
twoOrEleven: 但是SparseArray里有没有能替代hashMap中的containsKey()的Api呢?
qq_29964245: PC服务器端,改怎么弄博主
王虹芸: CSDN的博客可见性可以设置吗?
Burgessb: demo在哪
网友评论