MPVolumeView 与 XCode 4(故事板)
如何制作一个滑块来通过故事板调整设备的音量级别?我还没有找到任何与 XCode 4 相关的信息。 MPVolumeView 仍然是可行的方法吗?如果是这样,我该如何实施?
谢谢。
How do you make a slider that adjusts the volume level of the device with storyboarding? I haven't found any information on this relevant to XCode 4. Is MPVolumeView still the way to go? If so, how do I implement it?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您仍然可以在 Xcode 4.x 和 iOS5 中使用 MPVolumeView。只需导入 MediaPlayer 框架(也在项目设置中链接到它)并使用类似以下内容:
这将为您提供拖动时会改变系统音量的滑块。
You can still use an MPVolumeView in Xcode 4.x and iOS5. Simply import the MediaPlayer framework (link to it in your project settings, too) and use something like this:
This will give you the slider that will change system volume when dragged.
如果您想使用滑块,您可以将一个滑块添加到视图中并将其链接到相应视图控制器中的操作。动作看起来像这样:
If you want to use a slider, you can add one to your view and link it to an action in the corresponding view controller. The action looks like this: