applicationMusicPlayer卷通知 [英] applicationMusicPlayer volume notification
问题描述
我正在使用applicationMusicPlayer,当我尝试更改音量时会出现视觉通知,如图所示。
这里是我正在使用的代码:
I am using an applicationMusicPlayer and when i try to change the volume appear the visual notification, as shown in the picture. Here the code I am using:
[MPMusicPlayerController applicationMusicPlayer] setVolume:newVolune];
任何人都知道如何隐藏此通知?
Anyone knows how to hide this notification?
推荐答案
我不知道文档在哪里这么说,但是如果你向你的应用添加一个 MPVolumeView
视图,系统卷覆盖就会消失。即使它不可见:
I don't know where the docs says so, but if you add a MPVolumeView
view to your app the system volume overlay goes away. Even if it is not visible:
- (void) viewDidLoad
{
[super viewDidLoad];
MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame: CGRectZero];
[self.view addSubview: volumeView];
[volumeView release];
...
}
您可以使用硬件音量按钮, setVolume
方法或直接与叠加层未显示的控件(如果可见)进行交互。
You can use the hardware volume buttons, the setVolume
method or directly interact with the control (if visible) that the overlay doesn't show up.
这篇关于applicationMusicPlayer卷通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!