源码

首页 » 归档 » 源码 » 源码推荐(0628):动态更改navigationBar的透明度,自界说collectionView结构瀑布流 ,线性,-ios学习从入门到精通尽在姬长信

源码推荐(0628):动态更改navigationBar的透明度,自界说collectionView结构瀑布流 ,线性,-ios学习从入门到精通尽在姬长信

分享最热门的ios资讯

动态更改navigationBar的透明度(相当于教程)(上传者:zeroj)

代码中提供了多种实现动态更改导航条alpha的要领, 同时提供了一个对照简单的可以直接使用的分类

自界说collectionView结构瀑布流 ,线性, 圆形(上传者:zeroj)

自界说collectionView的常见的结构, 瀑布流 ,线性, 圆形, 可以直接使用

包装了一个富文本类(上传者:更多_)

/获取url数组
NSArray *urlArr = [SHMatching urlArrWithString:str];
//电话
NSArray *phoneArr = [SHMatching phoneNumArrWithString:str];
//邮箱
NSArray *emailArr = [SHMatching emailStringArrWithString:str];
NSAttributedString *att_str1 = [[NSAttributedString alloc]initWithString:str];
//识别url
NSAttributedString *attstr = [SHAttributedString attributedStringWithString:str andUrlStringName:nil line:NO];
//指定url名称
attstr = [SHAttributedString attributedStringWithAttString:att_str1 andUrlStringName:@"百度" urlStr:@"http://www.baidu.com" line:YES];
attstr = [SHAttributedString attributedStringWithAttString:attstr andUrlStringName:@"微博" urlStr:@"http://www.weibo.com"line:YES];
//改变指定位置文字颜色
NSAttributedString *att_str = [SHAttributedString attributedStringWithAttributedString:attstr andColor:[UIColor blackColor] font:[UIFont fontWithName:@"Arial" size:20] range:NSMakeRange(0, attstr.length)];
//插入图片
att_str = [SHAttributedString attributedStringWithAttributedString:att_str insertImage:[UIImage imageNamed:@"compose_emoticonbutton_background_highlighted@2x"] atIndex:3];
//识别电话
att_str = [SHAttributedString attributedPhoneStringWithString:att_str insertImage:[UIImage imageNamed:@"chatBar_colorMore_audioCallSelected@2x"] orPhoneNameString:nil isCall:NO];
//识别邮箱
att_str = [SHAttributedString attributedEmailStringWithString:att_str insertImage:[UIImage imageNamed:@"compose_emoticonbutton_background_highlighted@2x"] orEmailNameString:@"邮箱"];
//计算size
CGSize size = [SHAttributedString attributedStringSizeWithAttString:att_str preinstallSize:CGSizeMake(self.view.frame.size.width-20, MAXFLOAT)];
self.myTextView.attributedText = att_str;

用意志战胜身体的惰性!

(1)

本文由 姬長信 创作,文章地址:https://blog.isoyu.com/archives/508.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:6 月 28, 2016 at 07:59 上午

关键词:

热评文章

发表回复

[必填]

我是人?

提交后请等待三秒以免造成未提交成功和重复