MPVolumeView not showing up in iOS Simulator

This code works fine on the physical iPhone 6, but on the iOS simulator, MPVolumeView is not displayed.

- (void)setUpVolumeView { CGRect sliderRect = CGRectMake(20, 400, 300, 20); self.myVolumeView = [[MPVolumeView alloc] initWithFrame:sliderRect]; [self.view addSubview: self.myVolumeView]; } 

self in this case is a ViewController.

Does anyone know why this is happening?

+6
source share
2 answers

MPVolumeView has, as far as I know, never worked in a simulator. It always either does not show anything or displays "No volume" in white text.

+8
source

It does not work, because it must reflect a system value that is not controlled by the simulator (that is, there are no hardware volume buttons, as is on the device itself).

+3
source

Source: https://habr.com/ru/post/985638/


All Articles