摘要: 1 #import 2 3 @interface NJProductViewController : UICollectionViewController 4 // 'UICollectionView must be initialized with a non-nil layout... 阅读全文
posted @ 2016-01-24 22:53 xiaocaoera 阅读(207) 评论(0) 推荐(0) 编辑
摘要: #import @interface NJProductViewController : UICollectionViewController// 'UICollectionView must be initialized with a non-nil layout parameter'// 创建U... 阅读全文
posted @ 2016-01-24 22:29 xiaocaoera 阅读(637) 评论(0) 推荐(0) 编辑
摘要: 1 #import 2 3 @interface NJProductItem : NSObject 4 /** 5 * 图标 6 */ 7 @property (nonatomic, copy) NSString *icon; 8 /** 9 * 标题10 */11 @proper... 阅读全文
posted @ 2016-01-24 19:03 xiaocaoera 阅读(589) 评论(0) 推荐(0) 编辑
摘要: 1 #import 2 3 @interface NJNavigationController : UINavigationController 4 5 @end 6 7 8 9 #import "NJNavigationController.h"10 11 @interface NJ... 阅读全文
posted @ 2016-01-24 18:12 xiaocaoera 阅读(537) 评论(0) 推荐(0) 编辑
摘要: 1 #import 2 3 @interface NJTitleButton : UIButton 4 5 @end 6 7 8 #import "NJTitleButton.h" 9 10 @interface NJTitleButton ()11 @property (nonatom... 阅读全文
posted @ 2016-01-24 17:52 xiaocaoera 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 1 // 3.设置导航条的主题 2 // 如果要同时设置很多UINavigationBar的样式, 可以通过设置UINavigationBar的主题的方式来设置以便简化代码 3 UINavigationBar *navBar = [UINavigationBar appea... 阅读全文
posted @ 2016-01-24 15:12 xiaocaoera 阅读(450) 评论(0) 推荐(0) 编辑
摘要: 1 #import 2 3 @protocol NJTabBarDelegate 4 /** 5 * @param from 从哪个视图(视图索引) 6 * @param to 到哪个视图(视图索引) 7 */ 8 - (void)tabBarDidSelectBtnFrom:... 阅读全文
posted @ 2016-01-24 14:34 xiaocaoera 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1 #import "NJViewController.h" 2 3 @interface NJViewController () 4 @property (weak, nonatomic) IBOutlet UIView *cutomView; 5 6 @end 7 8 @implemen... 阅读全文
posted @ 2016-01-24 11:59 xiaocaoera 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1 // 平移动画 2 CABasicAnimation *a1 = [CABasicAnimation animation]; 3 a1.keyPath = @"transform.translation.y"; 4 a1.toValue = @(100); 5 ... 阅读全文
posted @ 2016-01-24 11:54 xiaocaoera 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1 #import "NJViewController.h" 2 3 @interface NJViewController () 4 @property (weak, nonatomic) IBOutlet UIImageView *iconView; 5 - (IBAction)nextBt... 阅读全文
posted @ 2016-01-24 11:53 xiaocaoera 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 1 #import "NJViewController.h" 2 3 #define angle2Radian(angle) ((angle) / 180.0 * M_PI) 4 5 @interface NJViewController () 6 7 @property (weak, no... 阅读全文
posted @ 2016-01-24 11:31 xiaocaoera 阅读(547) 评论(0) 推荐(0) 编辑
摘要: 1 #import "NJViewController.h" 2 3 @interface NJViewController () 4 5 @property (weak, nonatomic) IBOutlet UIView *customView; 6 - (IBAction)btnCli... 阅读全文
posted @ 2016-01-24 11:30 xiaocaoera 阅读(197) 评论(0) 推荐(1) 编辑
摘要: Core Animation,中文翻译为核心动画,它是一组非常强大的动画处理api,使用它能做出非常绚丽的动画效果,而且往往事半功倍。也就是说食用少量的代码就能实现非常强大的功能。Core Animation可以用在Mac OS X和IOS平台Core Animation的动画执行过程都是在后台操作... 阅读全文
posted @ 2016-01-24 11:26 xiaocaoera 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 两种方式 1 #import 2 3 @interface NJLayer : CALayer 4 @end 5 6 7 #import "NJLayer.h" 8 9 @implementation NJLayer10 11 // 重写该方法, 在该方法中给layer上绘制图形12 //... 阅读全文
posted @ 2016-01-24 10:27 xiaocaoera 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 1. 每一个UIView内部都默认关联着一个CALayer,我们可以称这个Layer为Root Layer2. 所有的非Root Layer,也就是手动创建的CALayer对象都存在着隐式动画什么是隐式动画 1 当对非Root Layer的部分属性进行修改时,默认会自动产生一些动画效果 2 而这... 阅读全文
posted @ 2016-01-24 10:13 xiaocaoera 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 1 // 如果一个控制是另外一个控件的子控件, 那么这个控件中的layer也是另外一个控件的子layer2 NSLog(@"star - %@", self.view.layer.sublayers);3 CALayer *layer = [CALayer layer];4... 阅读全文
posted @ 2016-01-24 00:04 xiaocaoera 阅读(115) 评论(0) 推荐(0) 编辑