- 博客(10)
- 收藏
- 关注
原创 iOS PhotoKit
PhotoKit的基本构成:PHAsset:代表照片库中的一个资源,和ALAsset类似, 通过PHAsset可以获取和保存资源。PHFetchOptions:获取资源时的参数,可以传nil,即使用系统默认值。PHAssetCollection:PHCollection的子类,表示一个相册或者一个时刻,或者是一个智能相册。PHFetchResult:表示一系列的资源结果集合,也可以是相册的集合,从P
2016-12-26 11:46:28 613
原创 cocos2d——动作
注:设置成员变量 private: cocos2d::Sprite* sprite;1.移动auto moveto =MoveTo::create(2, Vec2(40, 80));sprite->runAction(moveto);2.动作组(Sequence)auto hideAction = Hide::create();auto moveTo = MoveTo::create
2016-12-15 14:19:16 451
原创 cocos2d学习笔记——基础控件
通用的高度 auto visibleSize =Director::getInstance()->getVisibleSize(); Vec2 origin =Director::getInstance()->getVisibleOrigin(); 1.按钮auto startItem =MenuItemFont::create("Start", CC_CALLBACK_1(NextScene
2016-12-15 10:23:11 476
原创 ios 如果获取cell上控件相对于屏幕的坐标
UIWindow * window=[[[UIApplication sharedApplication] delegate] window];CGRect frame=[self convertRect: self.bounds toView:window];textfield不被键盘遮挡UIWindow * window=[[[UIApplication sharedApplication]
2016-12-13 14:29:53 4034
原创 iOS CGImageRef
图片截取 UIImageView * imgView =[[UIImageView alloc]initWithFrame:CGRectMake(0, 100, 420, 375)]; [self.view addSubview:imgView]; UIImage * img =[UIImage imageNamed:@"zc.jpg"]; CGImageRef imgR
2016-12-09 17:12:35 611
原创 UIKit Dynamics
1.重力效果 UIImageView * lview =[[UIImageView alloc]initWithFrame:CGRectMake(20, 100, 40, 40)]; lview.image =[UIImage imageNamed:@"zc.jpg"]; [self.view addSubview:lview]; animator = [[UIDynam
2016-12-08 16:18:39 287
原创 alloc init问题
for (int i =0; i<4; i++) { btn =[[UIButton alloc]initWithFrame:CGRectMake(40+60*i, 100, 40, 40)]; btn.backgroundColor =[UIColor redColor]; btn.tag =100+i; [btn addTarget
2016-12-03 13:37:04 328
转载 iOS获取键盘高度
- (void)viewDidLoad{ [super viewDidLoad]; //增加监听,当键盘出现或改变时收出消息 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWil
2016-12-01 09:20:34 820
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人