문제

I'm trying to change the volume in my app with a UISlider. The code I'm using for this is:

[[MPMusicPlayerController applicationMusicPlayer] setVolume:_volumeSlider.value];

The problem with this code is that it shows the volume box from the iPhone the same one that appears when you press the volume up or volume down buttons in the left part of the iPhone. For my app I need to hide this box, because the only thing I care is changing the volume.

도움이 되었습니까?

해결책

Use an MPVolumeView. It stays in sync with the system volume (adjusting itself when the user, e.g., hits one of the hardware volume buttons), and, more relevantly, suppresses the volume bezel when adjusted.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top