I am working on a radio application, and need to customize the volume tracker colors.
myVolumeView = [[MPVolumeView alloc] initWithFrame: CGRectMake(26, 292, 268, 23)];
[self.view addSubview: myVolumeView];
for (id current in myVolumeView.subviews) {
if ([current isKindOfClass:[UISlider class]]) {
UISlider *volumeSlider = (UISlider *)current;
volumeSlider.minimumTrackTintColor = [UIColor redColor];
volumeSlider.maximumTrackTintColor = [UIColor lightGrayColor];
//[volumeSlider setThumbImage:[UIImage imageNamed:@"volTrack.png"] forState:UIControlStateNormal];
}
}
If I run the code like this, it causes a weird bug:
But if I comment out the max track color, it works (although no customized color).
Any remedies for this? I am running 7.1.1