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...)

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top