1

I have sort of the reverse problem expressed here in this S.O. question

In my case, I (iPhone 4.3 GM) and a tester (iPhone 4.3.1) are seeing the behavior that when we adjust the volume with our finger on the MPVolumeView or with the physical volume switches, the speaker volume overlay is always appearing (see screenshot). screenshot of speaker overlay on top of MPVolumeView

Here is the code where I create the MPVolumeView. I think it is totally generic and standard:

    MPVolumeView *volumeView = [[[MPVolumeView alloc] initWithFrame:volumeSlider.bounds] autorelease];
[volumeSlider addSubview:volumeView];

*volumeSlider is simply an outlet to a plain UIView that I put on in IB.

The one other thing I can think of is that in IB, the volumeView view is checked as hidden. Then I unhide it when my audio starts playing (it is an audio streaming app).

Thank you for any help!

Community
  • 1
  • 1
Paul Bruneau
  • 1,026
  • 1
  • 9
  • 15
  • 1
    Might be relevant: http://stackoverflow.com/questions/3845222/iphone-sdk-how-to-disable-the-volume-indicator-view-if-the-hardware-buttons-are – magma Apr 27 '11 at 20:06
  • Thank you. Related, but not a solution for me. They are trying to hide the slider I believe. – Paul Bruneau Apr 27 '11 at 20:15
  • OK by doing some hacking I found a solution. First, I unchecked "hidden" in IB. Just by doing this, the overlay stayed away. But I still wanted to hide the MPVolumeView when no sound is playing. So I put a setHidden:YES message in my -viewDidLoad method, but then the overlay came back! So I had to have a timer set for .01 in the future call a method that hid the MPVolumeView. Apparently Apple is checking a bit after the view becomes visible to see if there is a visible MPVolumeView and if you hide it too fast, then Apple never sees it. Weird. – Paul Bruneau Apr 27 '11 at 20:15
  • 1
    Dammit, this didn't fix it after all, I'm still seeing the issue. – Paul Bruneau May 13 '11 at 13:07
  • Paul, did you ever find a solution to this as I am having the same problem with iOS 5? – amergin Oct 24 '11 at 17:16
  • Nope, the problem is still there and I have no more ideas on how to fix it :( – Paul Bruneau Oct 25 '11 at 02:24

2 Answers2

0

Take UIView in xib and bind with IBOutlet MPVolumeView.

I know this post is old,but if anyone wants this answer.

S S
  • 646
  • 1
  • 7
  • 16
-1

If you want to suppress the overlay while using the device volume buttons, simply move the frame of the MPVolumeView off the screen. The overlay will not appear.

3no
  • 1
  • 3