iOS 视觉差
来源:互联网 发布:北大青鸟学java编程 编辑:程序博客网 时间:2024/06/02 05:45
就是iPhone上icon随着手机的角度来上下左右移动
主要一个类 UIInterpolatingMotionEffect,应用也很简单,代码在下面
self.subview = [[UIView alloc] init]; self.subview.backgroundColor = [UIColor redColor]; [self.view addSubview:self.subview]; CGFloat screenW = [UIScreen mainScreen].bounds.size.width; CGFloat screenH = [UIScreen mainScreen].bounds.size.height; self.subview.frame = CGRectMake((screenW - 100)/2, (screenH - 100)/2, 100, 100); UIInterpolatingMotionEffect *effect1 = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis]; effect1.maximumRelativeValue = @100; effect1.minimumRelativeValue = @-100; [self.subview addMotionEffect:effect1]; UIInterpolatingMotionEffect *effect2 = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis]; effect2.maximumRelativeValue = @100; effect2.minimumRelativeValue = @-100; [self.subview addMotionEffect:effect2];
阅读全文
0 0
- iOS 视觉差
- iOS TableView滚动时的视觉差效果
- 滚动视觉差原理
- UITableView 视觉差效果
- 视觉差引导界面
- Stellar--视觉差滚动插件
- 刘惠斌:游戏视觉的差异化设计
- CSS3网页固定背景视觉差特效
- Cocos2dx_视觉差效果层ParallaxNode
- 一个简单的视觉差效果
- Android ViewPager Parallax视觉差切换动画
- 利用视觉差实现图片滑动
- 经常用到的视觉差parallax
- 视觉差插件parallux和rellax
- 京东商品详情视觉差效果
- 简单的视觉差页面滚动效果
- iOS模拟网络差
- 11个视觉差滚动效果的HTML5网站
- 判断一个字符串是否包含一个子串
- 指针和数组的对比
- 还原vim默认配置或者卸载vim
- android帧动画代码示例
- Sukodu Solver(深搜)
- iOS 视觉差
- redis五种基本数据类型
- CMPP3.0实现物联网卡发短信遇到的问题
- 读取csv文件到数据库
- mybatis基础
- Codeforces831A Unimodal Array
- JavaScript中Array对象
- 【jzoj5222】【GDOI2018模拟7.12】【A】【数据结构】
- BigDecimal 除法运算出现 java.lang.ArithmeticException