applicationMusicPlayer volume notification

后端 未结 6 1221
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 02:28

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:

[         


        
6条回答
  •  执笔经年
    2020-11-30 03:28

    For me, on iOS 7, none of above solutions worked. Here is how I did it:

    _volume = [[MPVolumeView alloc] initWithFrame: CGRectMake(-100,-100,16,16)];
    _volume.showsRouteButton = NO;
    _volume.userInteractionEnabled = NO;
    [self.view addSubview:_volume];
    [_volume release];
    

    That is, simply set MPVolumeView's frame to an off-screen location such as (-100,-100).

提交回复
热议问题