I'm trying to place the airplay button of a MPVolumeView
inside a UIBarButtonItem
's view, but the button won't show up. I'm debugging the view's hierarchy (Shown in the image below), it clearly shows that it is there, at the top of the hierarchy even, but it won't show in device.
Asked
Active
Viewed 590 times
2

Arnold Plakolli
- 206
- 4
- 10
-
Found a trick here to display permanently airplay button: https://stackoverflow.com/a/46787632 – raphael Oct 17 '17 at 10:14
1 Answers
1
Manage Airplay button is very frustrating because you have to deal with action taken by the operative system. In my experience, assuming that the MpVolumeView button is placed correctly in your viewcontroller, you have to check the Alpha value of the MpButton inside MpVolumeView.
As you know MpVolumeView is composed by three different subview:
- MPVolumeSlider;
- MPButton (route button);
- MPLabel.
You have to look inside the subviews of the MPVolumeView and check the alpha of the MPButton (route button), because probably this value has been changed by the operative system, and as result you are not able to see the button on the screen (remember: Alpha = 0 view is not visible, Alpha = 1 view is visible).

axl coder
- 739
- 3
- 19