I’m having trouble positioning a MPVolumeView. In the viewDidLoad method of my viewController I have this code:
[super viewDidLoad];
MPVolumeView *myVolumeView = [[MPVolumeView alloc] initWithFrame: self.volumeView.bounds];
[self.volumeView addSubview: myVolumeView];
In the storyboard I’ve added the volumeView and I have hooked it up to the controller.
I’m including two screenshots: one of the storyboard and one of how the view looks when it is running on my phone.
How can I position the MPVolumeView in the volumeView?


The simplest way to do this is to create an
MPVolumeViewin Interface Builder instead of in code. You can do this by dragging a customUIViewinto the XIB, configuring it as needed, and then changing its class toMPVolumeView.