Ios mpvolumeview route button not vertically centered on ios 7.1 update

I am creating an application that plays audio files. I am showing mpvolumeview which is working fine. but the problem is that I updated ios 7.1. the route button has lowered. see attached image enter image description here

I don’t know what happened to another simple ui slider, everything is fine with them. but mpvolumeslider ran into this problem after ios 7.1.

I am using this code to add a volume manager.

*MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame:myView.bounds] ;
 [myView addSubview:volumeView];*
+4
source share
2 answers

I had this problem, and it turned out that after creating the MPVolumeView, the code looked at the MPVolumeView routines to find the UISlider and configure it minimum/maxmimumTrackTintColor.

, :

[volumeView setTintColor:[UIColor darkGrayColor]];
+1

, , :

[volumeView setMinimumVolumeSliderImage:[UIImage imageNamed:@"minImg"] forState:UIControlStateNormal | UIControlStateDisabled];

[volumeView setMaximumVolumeSliderImage:[UIImage imageNamed:@"maxImg"] forState:UIControlStateNormal | UIControlStateDisabled];
+1

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


All Articles