Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
392 views
in Technique[技术] by (71.8m points)

ios - Hide device Volume HUD view while adjusitng volume with MPVolumeView slider

I was implementing a video player with MPMoviePlayer in my iPad Application, used MPVolumeView for the volume control. My problem is that when i scroll the volume view to adjust the volume is showing the device's volume hud overlay as in the screenshot below.

enter image description here

How can i disable this system volume indicator hud? My code is :

@property (weak, nonatomic) IBOutlet MPVolumeView *playbackMPVolumeView;

//Customizing controller
- (void)customizeVolumeController
{
    _playbackMPVolumeView.showsRouteButton  = YES;
    _playbackMPVolumeView.showsVolumeSlider = YES;
    [_playbackMPVolumeView setVolumeThumbImage:[UIImage imageNamed:@"volume_slider_thumb.png"] forState:UIControlStateNormal];
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Swift 3

let volumeView = MPVolumeView(frame: .zero)
view.addSubview(volumeView)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...