检测iphone晃动
来源:互联网 发布:淘宝u站9块邮 编辑:程序博客网 时间:2024/04/28 07:23
/** Module Name: UIAccelerometer Description: Explain how to use UIAccelerometer Author: Su XinDe Created: 1:06 12/27/2011 Last Change: 1:06 12/27/2011 */ //UIAccelerometer - (void)viewDidLoad{ //...... UIAccelerometer *accelerometer = [UIAccelerometer sharedAccelerometer]; accelerometer.delegate = self; accelerometer.undateInterval = 1.0f / 60.0f; //tiem interval , 60 times per second, the max support value is 100 times per second //......}- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceletration *)acceleration{ //Log the coordinate value changing when you shake the phone //NSString *numberOfShake = [[NSStirng alloc] initWithFormat:@"x:%g\ty:%g\tz:%g",acceleration.x,acceleration.y,acceleration.z]; //shakeValueLabel.text = numberOfShake; //[numberOfShake release]; //inspecting the shaking, and do the thing you want the phone to do if(fabsf(acceleration.x)>2.0||fabsf(acceleration.y>2.0)||fabsf(acceleration.z)>2.0) { // do the operation you want to do //just like //NSLog(@"Shaking movement inspected"); } }参考: http://hi.baidu.com/suxinde2009/item/60f003ebacb4cde9fb42ba53
- iphone 晃动检测方法
- 检测iphone晃动
- iPhone 判断手机晃动
- ios晃动的检测
- iOS - 晃动检测
- iphone手机晃动-----加速计
- IOS检测晃动的两种方式
- IOS检测晃动的两种方式
- 手机晃动的检测 相关资料
- iphone开发秘籍 - 监测晃动2种方法
- Android仿iPhone晃动撤销输入功能(微信摇一摇功能)
- Android仿iPhone晃动撤销输入功能(微信摇一摇功能)
- Android仿iPhone晃动撤销输入功能(微信摇一摇功能)
- iPhone中删除app时icon晃动的动画
- Android仿iPhone晃动撤销输入功能(微信摇一摇功能)
- ios手机晃动检测,图片抖动,手机震动功能
- Iphone检测网络状态
- iPhone 检测互联网连接
- UVaOJ 537
- 使用java 正则表达式 只替换排除< >之内的内容
- android-AsynTask
- An unexpected output caused by misunderstood non-greedy mode of regular expression in PHP
- OpenVPN
- 检测iphone晃动
- 0411华工招聘会
- 设计模式主要分三个类型:创建型、结构型和行为型。
- GDI+编程(二)使用画笔
- struts(二)
- dos命令 通过IP查看机器名
- NYOJ - 单调递增最长子序列(经典dp)
- windows下设置tomcat开机时启动
- Unicode下CString与char*的转换