摘要: 有时做项目会遇到这样一种需求, 控件显示的字体要求为自定义, 具体实现如下:1. 将字体文件(.ttc, .ttf, .odf)添加到工程内:2. 在工程内的Info.plist添加Fontsprovided by application, 其下添加一个键值key -> Item 0, value ... 阅读全文
posted @ 2015-10-21 14:27 HappyPlane 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 10.10系统搭建Apache服务器, 基本步骤如下:一、新建目录, 存放网页和资源:目录一般路径设置为: /Users/username/Sitesusername为当前用户名二、备份Apache配置文件httpd.conf:进入httpd.conf文件目录:cd /etc/apache2查看当前... 阅读全文
posted @ 2015-10-12 20:12 HappyPlane 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 第一步: 布置需要放大的TopView:1. 创建TopViewUIImageView *topView = [[UIImageView alloc] init];2. 设置图片UIImage *image = [UIImage imageNamed:@"Big.jpg"];topView.imag... 阅读全文
posted @ 2015-09-30 14:07 HappyPlane 阅读(1001) 评论(0) 推荐(0) 编辑
摘要: 最近手动导入AFNetworking 2.6.0框架时发现Xcode报如下错误:1. Use of undeclared identifier 'kSecFormatUnknown'2.Use of undeclared identifier 'kSecItemPemArmour'3. Implic... 阅读全文
posted @ 2015-09-23 15:39 HappyPlane 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 1. TextView/TextField光标颜色可通过设置tintColor属性进行修改:self.textView.tintColor = [UIColor redColor];2. TextView/TextField自定义光标长度或高度, 可通过重写父类方法caretRectForPosit... 阅读全文
posted @ 2015-09-09 16:17 HappyPlane 阅读(4890) 评论(0) 推荐(0) 编辑
摘要: 当面向字典开发或服务器返回的数据为字典时,应当判断字典内是否包含对应的key值,从而避免返回key值为空而导致程序奔溃:NSDictionary *dict = self.datas[indexPath.row];if([[dict allKeys] containsObject:@"key"]){... 阅读全文
posted @ 2015-09-06 19:59 HappyPlane 阅读(2029) 评论(0) 推荐(0) 编辑
摘要: 原生TextView无占位文字, 可通过drawRect:方法为其添加占位文字, 具体设置如下:1. 获取当前占位文字属性:// 文字属性NSMutableDictionary *attrs = [NSMutableDictionary dictionary];attrs[NSFontAttribu... 阅读全文
posted @ 2015-09-04 12:51 HappyPlane 阅读(548) 评论(0) 推荐(0) 编辑
摘要: 1. 创建刷新控件, 并将控件设置到TableView的tableFooterView:- (void)setupUpRefresh{ FooterView *refreshFooterView = [FooterView refreshFooterView]; refreshFoote... 阅读全文
posted @ 2015-09-02 13:39 HappyPlane 阅读(1867) 评论(0) 推荐(0) 编辑
摘要: 1. 创建刷新控件, 可通过xib或代码方式创建控件:- (void)setupDownRefresh{ /* 添加刷新控件 */ UIRefreshControl *control = [[UIRefreshControl alloc] init]; // 监听事件 ... 阅读全文
posted @ 2015-08-31 23:43 HappyPlane 阅读(654) 评论(0) 推荐(0) 编辑
摘要: TextField内容为空时设置按钮为不可用, 也可通过通知或代理实现。 但是用代理实现时, 存在一个Bug: 用户在输入文本首字段时, 进行回删操作后输出(如“shuai” -> "shu"), 按钮依旧为不可用,同时若嫌通知或代理实现过于繁琐,也可通过addTarget:action:forCo... 阅读全文
posted @ 2015-08-19 13:17 HappyPlane 阅读(600) 评论(0) 推荐(0) 编辑