1
是否有可能让UIGestureRecognizer检测垂直滑动并从我的应用调整音量。使用垂直滑动音量
因此,如果用户垂直向上滑动,音量会增加,并且如果用户向下滑动,音量会减小。
我对播放音频代码:
AppDelegate *appDelegate= (AppDelegate *)[[UIApplication sharedApplication] delegate];
if (appDelegate.countSound == 1) {
// OFF
appDelegate.backgroundMusic.volume = appDelegate.countSound;
appDelegate.countSound = 0;
}
else
{
// ON
appDelegate.backgroundMusic.volume = appDelegate.countSound;
appDelegate.countSound = 1;
}
任何代码将高度赞赏,
干杯乔。
添加UIPanGestureRecognizer到您的视图。这里是一个例子http://stackoverflow.com/questions/6672677/how-to-use-uipangesturerecognizer-to-move-object-iphone-ipad – 2012-02-28 09:39:26
一个技巧可能是使用简单的滑动手势与您的控制视图,然后进行旋转变换该控制视图为90度。 – Ravin 2012-02-28 09:45:46