开发者

iPhone: Implement Volume control using buttons

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 t开发者_StackOverflowo 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.


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; }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜