调用手机震动
2016-04-27 18:58
267 查看
所谓调用手机的震动,其实就是调用系统声音的一种。就一句代码:
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
仅支手机(ipnone)。 ipad 、touch 都不支持
NSString *devieModel = [[UIDevice currentDevice]model];
NSLog(@"device %@",devieModel);
if ([devieModel isEqualToString:@"iPhone"])
{
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
}else
{
UIAlertView *alerView = [[UIAlertView alloc]initWithTitle:@"warning" message:@"Your device is not supported" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:
nil];
[alerView show];
}
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
仅支手机(ipnone)。 ipad 、touch 都不支持
NSString *devieModel = [[UIDevice currentDevice]model];
NSLog(@"device %@",devieModel);
if ([devieModel isEqualToString:@"iPhone"])
{
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
}else
{
UIAlertView *alerView = [[UIAlertView alloc]initWithTitle:@"warning" message:@"Your device is not supported" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:
nil];
[alerView show];
}
相关文章推荐
- Android之获取手机上的图片和视频缩略图thumbnails
- android wifi 无线调试
- 5 个可以满足你的生产力、沟通和娱乐需求的开源手机应用
- 每日安全资讯:哪些属于App违法违规收集使用个人信息?
- 手机4大隐藏功能及使用必知常识第1/2页
- Android改变手机屏幕朝向的方法
- php实现用手机关闭计算机(电脑)的方法
- 基于JavaScript代码实现pc与手机之间的跳转
- js判断手机和pc端选择不同执行事件的方法
- JS判断客户端是手机还是PC的2个代码
- 手机屏幕尺寸测试――手机的实际显示页面的宽度
- Android中手机震动的设置(Vibrator)的步骤简要说明
- android获取手机唯一标识的方法
- android开发之蜂鸣提示音和震动提示的实现原理与参考代码
- jQuery实现的Div窗口震动特效
- 让手机访问WAP网站服务器 IIS WAP服务器的MIME类型设置
- jQuery手机拨号界面特效代码分享
- 手机短信轰炸(图)
- 手机怎么访问电脑服务器上的网页