What's the best way to use a UISlider to change the volume of the iPhone in an app?
I've tried using that Bill (Using a UISlider to change volume)
But nothing appears on the screen using the code:
MPVolumeView *volumeView = [[[MPVolumeView alloc] initWithFrame:
CGRectMake(0, 0, 215, 22)] autorelease];
volumeView.center = CGPointMake(150,375);
[volumeView sizeToFit];
[self.view addSubview:volumeView];
I've just found a very easy way. Instead of coding, just place it in your XIB.
Voila!
PS: Tested it on a device with iPhone OS 3.0. As lostInTransit stated before, it won't work on the simulator.
Using a UISlider to change volume
^ I tried that lostintransit, however this is not changing the ringer volume. It comes up on the iphone screen, but doesn't change anything. Even using the demo project provided.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With