ios - ios中的平滑触摸
<p><p>当我过去按下按钮时,是否有任何代码可以使我的应用程序平滑振动。目前我正在使用以下方法。请看一下</p>
<pre><code>-(IBAction)buttonClicked:(UIButton *)sender
{
//AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
AudioServicesPlayAlertSound (1105);
self.view.userInteractionEnabled = NO;
[playSound:@"single_click_12"];
[HelperClass showBounceAnimatedButton:sender completionBlock:^{
self.view.userInteractionEnabled = YES;
selectedIndex =(int) sender.tag;
;
}];
// NSLog(@"Sender Tag :%li",(long)sender.tag);
}
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>即使启用,设备也不会振动。</p>
<p><code>1) AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
2) AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);</code></p>
<p>我的方法是在测量设备运动的特定时间调用的。我不得不停止录制,然后在振动发生后重新开始。</p>
<p>看起来像这样。</p>
<pre><code>-(void)vibrate {
;
AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);
;
// recorder is an AVRecorder instance.
}
</code></pre></p>
<p style="font-size: 20px;">关于ios - ios中的平滑触摸,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/32648808/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/32648808/
</a>
</p>
页:
[1]