簡體   English   中英

ios中的平滑觸摸

[英]Smooth touch in ios

當我以前按下按鈕時,是否有任何代碼可以使我的應用程序平滑振動。 目前我正在使用以下方法。 請看一看

-(IBAction)buttonClicked:(UIButton *)sender
{
     //AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
  AudioServicesPlayAlertSound (1105);
  self.view.userInteractionEnabled = NO;

   [[HelperClass shared]playSound:@"single_click_12"];
[HelperClass showBounceAnimatedButton:sender completionBlock:^{
    self.view.userInteractionEnabled = YES;
    selectedIndex =(int) sender.tag;
    [self performSelector:@selector(pushTheViewToGame) withObject:nil afterDelay:0.6];
}];

 // NSLog(@"Sender Tag :%li",(long)sender.tag);
}

即使啟用,設備也不會振動。

1) AudioServicesPlayAlertSound(kSystemSoundID_Vibrate); 2) AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

我的方法在測量設備運動的特定時間被調用。 我不得不停止錄音,然后在振動發生后重新啟動。

它看起來像這樣。

-(void)vibrate {
    [recorder stop];
    AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);
    [recorder start];
    // recorder is an AVRecorder instance.

}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM