01 2016 档案

摘要:- (CGFloat)getCellHeight:(UITableViewCell*)cell { [cell layoutIfNeeded]; [cell updateConstraintsIfNeeded]; CGFloat height = [cell.contentView systemLa 阅读全文
posted @ 2016-01-25 11:49 Mr_tao 阅读(576) 评论(0) 推荐(0)
摘要:@property (nonatomic, assign) NSInteger timeout; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(100, 100, 阅读全文
posted @ 2016-01-25 11:10 Mr_tao 阅读(146) 评论(0) 推荐(0)
摘要:1、 (1) 第一步,制定协议 //因为是ConfigViewController其他界面发送消息 // 1. 告诉其他界面我要给你发送什么消息 // 2. 确保其他实现了消息对应的方法 // 声明协议和协议方法 @protocol ConfigViewControllerDelegate <NSO 阅读全文
posted @ 2016-01-22 14:26 Mr_tao 阅读(380) 评论(0) 推荐(0)
摘要:1、开源库,利用pod引入第三方库MMDrawerController: 在建立的Podfile中加入代码: platform :ios, '7.0' pod 'ReactiveCocoa' pod 'MMDrawerController' pod 'Toast', '~> 3.0' pod 'Co 阅读全文
posted @ 2016-01-21 09:37 Mr_tao 阅读(705) 评论(0) 推荐(0)
摘要:1、NSMutableAttributedString总的来说一共有21个属性: NSFontAttributeName 设置字体属性,默认值:字体:Helvetica(Neue) 字号:12 NSForegroundColorAttributeNam 设置字体颜色,取值为 UIColor对象,默认 阅读全文
posted @ 2016-01-20 16:30 Mr_tao 阅读(706) 评论(0) 推荐(0)
摘要:1、首先在storyboard中拖两个imageView,是相互重叠的两个imageView,把要刮开显示的图片放到下面,上面的imageView显示要刮掉的图片,在上层显示的图片要开启交互功能,如图: 2、代码实现。 上层的imageView拖到控制器一个属性,同时再建立一个属性判断手指是否在触摸 阅读全文
posted @ 2016-01-19 16:19 Mr_tao 阅读(1390) 评论(0) 推荐(0)
摘要:1.获取本地时间的相关代码: NSDateFormatter* formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSString * date = [format 阅读全文
posted @ 2016-01-15 14:55 Mr_tao 阅读(362) 评论(0) 推荐(0)
摘要:1.模式为MRC的工程要兼容ARC的类需要做如下配置:Build Phases -》Compile Sources 在ARC模式的类后面添加-fobjc-arc 2.模式为ARC的工程要兼容MRC的类需要做如下配置:同上,在相应的类后面添加-fno-objc-arc 阅读全文
posted @ 2016-01-12 09:24 Mr_tao 阅读(376) 评论(0) 推荐(0)
摘要:1.首先引入第三方库:KeychainItemWrapper,下载地址:http://pan.baidu.com/s/1eRdEGSi 2.把KeychainItemWrapper.h和KeychainItemWrapper.m文件拉入工程,还要添加Security.framework; 3.由于这 阅读全文
posted @ 2016-01-11 15:53 Mr_tao 阅读(715) 评论(0) 推荐(0)
摘要:1.首先创建一个Image类,.h文件复制 + (UIImage *)captureWithView:(UIView *)view; 2.在.m文件中实现方法; + (UIImage *)captureWithView:(UIView *)view { // 1.开启上下文 UIGraphicsBe 阅读全文
posted @ 2016-01-08 11:51 Mr_tao 阅读(354) 评论(0) 推荐(0)
摘要:1.首先创建一个Image类,.h文件复制 /** * 打水印 * * @param bg 背景图片 * @param logo 右下角的水印图片 */ + (UIImage *)waterImageWithBg:(NSString *)bg logo:(NSString *)logo; 2.在.m 阅读全文
posted @ 2016-01-08 11:44 Mr_tao 阅读(1279) 评论(0) 推荐(0)
摘要:在一个工程中选中Editor--》Add Target 阅读全文
posted @ 2016-01-06 14:13 Mr_tao 阅读(150) 评论(0) 推荐(0)
摘要:首先用pod引入第三方库: MMDrawerController 在podfile中填写 platform :ios, '7.0' pod 'MMDrawerController' 在AppDelegate中引入头文件 #import <MMDrawerController.h> #import " 阅读全文
posted @ 2016-01-04 16:55 Mr_tao 阅读(2131) 评论(0) 推荐(0)
摘要:注:使用AFNetworking加载数据时,首先要添加HTTPs的白名单,设置详解见http://www.cnblogs.com/h-tao/p/5098877.html 判断网络状态: #pragma mark - 判断网络状态 - (void)judgeNetworkStatus { //原理: 阅读全文
posted @ 2016-01-04 14:44 Mr_tao 阅读(2074) 评论(0) 推荐(0)
摘要:在plist文件中添加 NSAppTransportSecurity,属性设置为字典,然后再下一级添加 NSAllowsArbitraryLoads,属性设置为bool型,设置为YES;如图: 或者直接把一下代码复制到plist文件当中 <key>NSAppTransportSecurity</ke 阅读全文
posted @ 2016-01-04 14:39 Mr_tao 阅读(547) 评论(0) 推荐(0)