Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone how hide volume overlay when press volume key

I have do lots to solve it,like add MPVolumeView,someone says that system volume HUD will hide if you add a instance of MPVolumeView in current,but that not work

i add obsever to observe the volume's change,and take picture

but now i lost in how hide the volume HUD

I had tried the solution that add MPVolumeView instance but won't WORK please give me another way to solve it

Any suggestions would be appreciated.

like image 550
cskevincs Avatar asked Dec 03 '25 17:12

cskevincs


1 Answers

You need to put volume overlay like this:

MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame: CGRectZero];
[self.view addSubview: volumeView];

Now the custom overlay won't be visible. But keep in mind that you are not able to get action on pressing volume buttons you can only be notified about its effect - changing a volume

like image 111
Julian Avatar answered Dec 05 '25 06:12

Julian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!