2015年10月12日
摘要: GitHub地址:https://github.com/Locking-Xu/XZGetAddressBook 阅读全文
posted @ 2015-10-12 20:29 不敢告诉她 阅读(240) 评论(0) 推荐(0)
摘要: 1.方法一:typedef enum{ one = 0, two,}Name;2.方法二:typedef NS_ENUM(NSInteger, name) { one, two};注:a.方法二必须在#import的下面 b.两种方法第一个枚举都是可以赋值也可不赋值,如果赋值的话,则以赋... 阅读全文
posted @ 2015-10-12 10:37 不敢告诉她 阅读(183) 评论(0) 推荐(0)
摘要: 使用静态TableView有两个前提,1.要在Storyboard上 2.需要使用TableViewControllerPS:如果需要设置不同的cell的高度不同的话,还是需要使用tableView的delegate。 阅读全文
posted @ 2015-10-12 09:27 不敢告诉她 阅读(391) 评论(0) 推荐(0)
  2015年10月11日
摘要: 1.设置NavigationBar的背景色: self.navigationController.navigationBar.barTintColor = [UIColor redColor];2.设置NavigationBar上的标题 self.navigationItem.title = @... 阅读全文
posted @ 2015-10-11 20:32 不敢告诉她 阅读(252) 评论(0) 推荐(0)
摘要: TabBar使用频率很高的一个组件,TabBar的TabBarItem有两个属性一个是image(未选中图片),另一个是selectedImage(选中时图片)但是运行时发现,选中时的图片变成了蓝色的,但是实际上图片是红色的,看来系统的TabBar会对图片默认使用TintColor再进行渲染。解决方... 阅读全文
posted @ 2015-10-11 14:04 不敢告诉她 阅读(709) 评论(0) 推荐(0)
  2015年10月10日
摘要: 情况描述:有两个ViewController,FatherViewController和ChildViewController,ChildViewController继承于FatherViewControllerFatherViewController实现单例方法:+ (*)shareInstanc... 阅读全文
posted @ 2015-10-10 10:32 不敢告诉她 阅读(519) 评论(0) 推荐(0)
  2015年10月9日
摘要: 参考自:原文地址(内容与原文并无区别,只是自己以后方便使用整理了一下)1.UIButton的background是不支持在针对不同的状态显示不同的颜色。2.UIButton的backgroundImage是针对不同的状态的,所以思路就是在不同状态下的的时候,生成指定颜色的纯色图片。关键代码:/***... 阅读全文
posted @ 2015-10-09 16:35 不敢告诉她 阅读(763) 评论(0) 推荐(0)
  2015年9月18日
摘要: 单例就是只有一个实例。两种常见的创建方法:1. : staticA*a=nil; +(A*)shareInstance { if(!a) a=[[selfalloc]init]; returna; }2: +(A*)shareInstance { stati... 阅读全文
posted @ 2015-09-18 11:52 不敢告诉她 阅读(133) 评论(0) 推荐(0)
  2015年9月16日
摘要: 当一个进入一个新viewController的时候,viewController的view的生命周期一般是这样的:1.先判断内存是否有这个Viewa.没有的话:生命周期为loadView->viewDidLoad->viewWillAppear->viewDidAppear->viewWillDis... 阅读全文
posted @ 2015-09-16 11:09 不敢告诉她 阅读(360) 评论(0) 推荐(0)
  2015年8月23日
摘要: 在IOS7 之后viewController有一个新的属性叫做edgesForExtendedLayout,这个属性指定viewController的view边缘延伸的方向,默认情况下是UIRectEdgeAll,所以view是向四周延伸的。这是属性是针对于viewController上的self.... 阅读全文
posted @ 2015-08-23 11:50 不敢告诉她 阅读(992) 评论(0) 推荐(0)