Could anyone please tell me how could I implement the functionality of adjusting the volume on button click? Basically I am trying to put two buttons Volume Up and Volume Down but I couldn't find anyway to adjust the volume of button click. This link mentions about the MPVolumeView but I can't find it in my XCode 4.0 objects list and also I am not sure if I can use that for button click volume adjust. Could someone please point me in correct direction.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If I'm understanding you correctly, your looking to have buttons to tell the iPhone to adjust the volume up or down. Although you may have better luck achieving this with a UIProgressView I would try playing around with something like this, either with multiple intended volumes each defined by the selected button, or create a variable and add or subtract from it in the ibaction ex myAudio.volume = x+.5;
...
- (IBAction) VolumeOne { myAudio.volume = 1.0; }