我正在使用JPSVolumeButtonHandler,但是在此操作中,我得到了“调高音量”按钮的动作。但是在此铃声和音量按钮弹出窗口中显示。怎么拍照?
最佳答案
在iOS 8中,您可以将观察者添加到通知中_UIApplicationVolumeUpButtonDownNotification
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(volumeChanged:)
name:@"_UIApplicationVolumeUpButtonDownNotification"
object:nil];
如果使用的是
UIImagePickerController
,则可以捕获事件并使用它通过自定义视图调用TakePicture
。最重要的是,
UIImagePickerController
确保提高音量不会改变音量。或者,您可以使用第三方库,例如JPSVolumeButtonHandler。
更新:
你可以做类似的事情,
MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame: CGRectZero];
[self.view addSubview: volumeView];
别忘了
@import MediaPlayer;
请参阅此Apple documentation以获得更多详细信息。
希望这会有所帮助:)
关于ios - 如何通过调高音量按钮拍照并在iOS中显示任何弹出窗口?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36881592/