Domanda

My app needs to fade some music in, starting from 0 and slowing going up to the iPod volume setting. When I do this, the stock Apple volume adjust screen shows up. I followed the directions in this question and create my own MPVolumeView.

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

This almost works perfectly, I do not see the system volume UI, which is good, but what I do see now is the AirPlay icon in the upper left hand corner. How can I make that go away?

(And yes, perhaps it would be better if the icon were there but sometimes the visual designer wins...)

È stato utile?

Soluzione

You need to set the showsRouteButton to NO.

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

But be aware this will also hide any bluetooth route available and the user can still select airplay via the quickswitch dock.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top