11.晃动事件
来源:互联网 发布:东方铃奈庵 知乎 编辑:程序博客网 时间:2024/04/28 22:08
晃动事件 实现晃动切换视图
1.创建两个继承于UIViewController的控制器RootViewController.h和SecondViewController.h
在RootViewController.m引入SecondViewController.h头文件
在RootViewController.m文件里实现方法
RootViewController是根控制器
在RootViewController.m里面
晃动事件
开始晃动触发方法
-(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
NSLog(@”开始晃动”);
}
晃动结束触发方法
-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
NSLog(@"结束晃动");创建SecondViewController控制器SecondViewController * secondVC = [[SecondViewController alloc] init];跳转到SecondViewController控制器的界面[self presentViewController:secondVC animated:YES completion:nil];释放[secondVC release];
}
晃动中断触发方法
-(void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
NSLog(@”中断晃动”);
}
在SecondViewController.m里
开始晃动触发方法
-(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
}
晃动结束触发方法
-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
跳转回上一个界面
[self dismissViewControllerAnimated:YES completion:nil];
}
晃动中断触发方法
- (void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
}
- 11.晃动事件
- HTML5晃动DeviceMotionEvent事件
- HTML5晃动DeviceMotionEvent事件
- android手机晃动事件实例
- android手机晃动事件实例
- [TwistedFate]触摸事件 晃动事件 target/action
- iOS开发 -- 事件处理(触摸,晃动)
- UI day 4 事件处理(UIEvent) 触摸 晃动 远程控制事件
- 晃动提醒
- 屏幕晃动
- iPhone 判断手机晃动
- iphone 晃动检测方法
- 检测iphone晃动
- ios晃动的检测
- iOS 晃动手势
- CAKeyframeAnimation实现晃动
- iOS 晃动手势
- iOS - 晃动检测
- 每天都写点东西出来 -- 第 10 天
- 项目中遇到的问题总结
- Shell 中参数变量$0,$?,$!,$#等的含义
- 01 CSDN心语
- 在PHP中使用AES加密算法加密数据
- 11.晃动事件
- 老王的故事
- 在c++中怎么实现把char实现int形输出
- ARM汇编伪指令介绍(全集)
- 在公司中怎样使用SVN、Git
- hdu 4325 Flowers
- ARM汇编语言中的程序结构
- 嵌入式底层软件开发学习系列之一目录
- 文章标题