Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top