随笔分类 -  代码片段

摘要:http://www.jianshu.com/users/5b9cf22a3692/latest_articles 阅读全文
posted @ 2016-11-04 10:11 回读(IOS) 阅读(184) 评论(0) 推荐(0)
摘要:一、使用UIWebView 将web content 嵌入到应用上。API提供了三种方法:- (void)loadRequest:(NSURLRequest *)request;- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)ba... 阅读全文
posted @ 2016-01-04 17:32 回读(IOS) 阅读(253) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/cny901111/article/details/26529949今天在做UISearchBar,UISearchDisplayController时遇到了一个问题,在点击搜索栏时阴影部分的位置出现偏差如下图:始终觉得很奇怪,后面单独做了一个demo,将同... 阅读全文
posted @ 2015-02-25 14:09 回读(IOS) 阅读(1101) 评论(0) 推荐(0)
摘要:- (void)drawRect:(CGRect)frame{ NSMutableParagraphStyle *textStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy]; textStyle.li... 阅读全文
posted @ 2015-01-25 11:22 回读(IOS) 阅读(2235) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/silencetq/article/details/8447400我是采用的AVAudioRecorder这个框架来进行录音这个录音跟官方网站上的speakHere有些区别,最大的区别是,这个必须要录制完成才能处理文件,而speakhere示例是可以实现边录... 阅读全文
posted @ 2015-01-06 11:35 回读(IOS) 阅读(212) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2014-12-11 23:05 回读(IOS) 阅读(914) 评论(0) 推荐(0)
摘要:要取到单个字符,就要知道字符串的编码方式,这样才能够定位每个字符在内存中的位置。但是,iOS的字符串编码是不固定的,因此,需要设置一个统一的编码格式,将所有其他格式的字符串都转化为统一的格式,然后就可以根据编码规则取到单个字符了。在这里,使用UTF-8编码。UTF-8编码的使用范围比较广泛,客户端与... 阅读全文
posted @ 2014-12-11 13:59 回读(IOS) 阅读(991) 评论(0) 推荐(0)
摘要:1 - (BOOL)isContainsEmoji:(NSString *)string { 2 __block BOOL isEomji = NO; 3 [string enumerateSubstringsInRange:NSMakeRange(0, [string lengt... 阅读全文
posted @ 2014-11-26 09:27 回读(IOS) 阅读(1537) 评论(0) 推荐(0)
摘要://创建button遮挡 UIButton *cover = [[UIButton alloc]initWithFrame:self.view.frame]; [cover setBackgroundColor:[UIColor blackColor]]; cover.alpha ... 阅读全文
posted @ 2014-11-06 09:05 回读(IOS) 阅读(276) 评论(0) 推荐(0)
摘要:判断横竖屏。http://www.cocoachina.com/ask/questions/show/121301//self.cameraView是相机view - (NSUInteger)supportedInterfaceOrientations{ UIInterfaceOrientat... 阅读全文
posted @ 2014-10-23 11:15 回读(IOS) 阅读(1874) 评论(0) 推荐(0)
摘要:button.exclusiveTouch = YES; 阅读全文
posted @ 2014-09-28 10:28 回读(IOS) 阅读(253) 评论(0) 推荐(0)
摘要:http://blog.sina.com.cn/s/blog_6f29e81f0101qwbk.html【问题描述】今天请求服务器返回的字段中含有空格,这空格是服务器开发人员不小心往数据中多敲了,所以在客户端需要把字符串中的空格过滤掉。【问题分析】1、使用NSString中的stringByTrim... 阅读全文
posted @ 2014-09-26 15:40 回读(IOS) 阅读(799) 评论(0) 推荐(0)
摘要:/** * 将UIColor变换为UIImage * **/+ (UIImage *)createImageWithColor:(UIColor *)color{ CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); UIGraphicsBe... 阅读全文
posted @ 2014-09-22 17:57 回读(IOS) 阅读(343) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/heartofthesea/article/details/222893991.将准备好的字体文件加入项目中2.打开Build Phases—Copy Bundle Resources,确保刚添加的字体文件在列表中,否则需要手动加到这里3.编辑”项目名-In... 阅读全文
posted @ 2014-09-15 15:57 回读(IOS) 阅读(270) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2014-09-11 10:25 回读(IOS) 阅读(149) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/dyllove98/article/details/8635079IdentifierValidator.h//// IdentifierValidator.h// 银行卡校验//// Created by 杨梦晓 on 14-9-9.// Copyrigh... 阅读全文
posted @ 2014-09-11 10:18 回读(IOS) 阅读(730) 评论(0) 推荐(0)
摘要:http://www.oschina.net/code/snippet_86738_3128效验是否为银行卡,用于验证现行 16 位银联卡现行卡号开头 6 位是 622126~622925 之间的,7 到 15 位是银行自定义的,可能是发卡分行,发卡网点,发卡序号,第 16 位是校验码。16 位卡号... 阅读全文
posted @ 2014-09-11 09:55 回读(IOS) 阅读(476) 评论(0) 推荐(0)
摘要:在模拟器上跑,图片会显示,而在真机上跑,图片不会显示。原因是真机上区分大小写。 阅读全文
posted @ 2014-09-01 11:04 回读(IOS) 阅读(170) 评论(0) 推荐(0)
摘要:如 AlertView,当 show 一个 Alert 时,它会覆盖在 Keyboard 上面,不影响显示的效果。那么我们自己创建的 View 如何像 Alert 那样不被键盘盖住呢?很简单,拿到 Application 的 最上面一个 window,把 View 加到这个 window 上,就可以... 阅读全文
posted @ 2014-08-26 11:14 回读(IOS) 阅读(424) 评论(0) 推荐(0)
摘要:在json数据没有错误 字符 的前提下 出现的问题如果有中文 那么编码格式 必须是UTF-8格式的 阅读全文
posted @ 2014-08-25 11:01 回读(IOS) 阅读(158) 评论(0) 推荐(0)