NSValue的使用
来源:互联网 发布:免费棋牌app源码 编辑:程序博客网 时间:2024/05/19 22:00
1、结构体转换成对象
CALayer的形变就要利用到它
#pragma mark - CALayer的形变- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ /* Returns a transform that rotates by 'angle' radians about the vector '(x, y, z)'. x 上下旋转;y 左右旋转,z 绕垂直屏幕的方向旋转 */ [UIView animateWithDuration:2 animations:^{ //旋转 // [self.imageView.layer setTransform:CATransform3DMakeRotation(M_PI, 1, 1, 0)];//(0,0,1),(0,0,0)构成一个Z轴的向量 //收放 // [self.imageView.layer setTransform:CATransform3DScale(self.imageView.layer.transform, 0.5, 0.5, 0.5)]; //平移// [self.imageView.layer setTransform:CATransform3DTranslate(self.imageView.layer.transform, 10, 10, 10)]; //KVC [self.imageView.layer setValue:[NSValue valueWithCATransform3D:CATransform3DTranslate(self.imageView.layer.transform, 20, 20, 20)] forKeyPath:@"transform"]; //[self.imageView.layer setValue:@M_PI forKeyPath:@"transform.rotation"]; }];}
transform的属性列表:
阅读全文
0 0
- NSValue的使用
- NSValue的使用
- NSNumber,NSValue,NSDate的使用
- OC之【NSValue的使用】
- OC中NSValue的使用
- 黑马程序员--NSValue的使用
- Objective-C中NSValue的使用
- Objective-C中NSValue的使用
- NSNumber、NSData、NSValue的使用场景
- Objective-C中NSValue的使用
- NSValue 值对象的定义和使用
- OC--NSValue、 NSNumber、NSNull、NSDate的使用
- Objective-C中NSValue的使用
- foundation的使用——NSNumber NSValue
- NSNumber与NSValue的基本使用
- 17-OC中NSValue的使用(把NSValue类型成任意类型包装)
- iOS中NSnumber的使用 NSValue的使用
- NSValue 使用(十二)
- ScrollView嵌套RecycleView之后 recycleView惯性消失
- spring学习笔记(1)
- windows跨进程共享
- nmap基本使用方法
- c++的运算符的重载的代码
- NSValue的使用
- CSS选择器总结
- 字符串的全排列和组合算法
- HDU5927-Auxiliary Set
- java的面向对象基础
- hihoCoder 第157周 二进制小数
- Get 请求中文参数乱码解析
- Ubuntu下NFS服务器的搭建与配置
- Python UDP Server and Client