iPhone:使用按钮实现音量控制
谁能告诉我如何实现单击按钮时调节音量的功能?基本上我试图放置两个按钮“音量调高”和“音量调低”,但我找不到调整按钮单击音量的方法。 此链接提到了 MPVolumeView,但我在 XCode 中找不到它4.0 对象列表,而且我不确定是否可以将其用于按钮单击音量调整。有人可以指出我正确的方向吗?
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我理解正确的话,您希望有按钮来告诉 iPhone 调高或调低音量。尽管使用 UIProgressView 实现这一点可能会更幸运
我会尝试使用类似的东西,要么使用每个由所选按钮定义的多个预期音量,要么创建一个变量并在 ibaction ex myAudio.volume = x+.5; 中添加或减去它。
...
myAudio.volume = 1.0;
}
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;
...
myAudio.volume = 1.0;
}