Question

Why iOS 6 SDK still uses old MPVolumeView control's style. I want to use default style like in Apple's Default Music application.

Old one: enter image description here

New one:

enter image description here

Is there any way to use new one in my project?

Thank you!

Était-ce utile?

La solution

There is an another way to do this without using an UISlider control.

UIImage *minImage = [UIImage imageNamed:@"bar-bg"];
UIImage *maxImage = [UIImage imageNamed:@"bar-bg-active"];
UIImage *tumbImage= [UIImage imageNamed:@"circle"];

// 276 x 14 px images used for min and max
// so i need to make the images into very small images by making resizable otherwise it strechs very ugly
minImage = [minImage resizableImageWithCapInsets:UIEdgeInsetsMake(0, 20, 0, 0)];
maxImage = [maxImage resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 20)];

[volumeManager setMinimumVolumeSliderImage:minImage forState:UIControlStateNormal];
[volumeManager setMaximumVolumeSliderImage:maxImage forState:UIControlStateNormal];
[volumeManager setVolumeThumbImage:tumbImage forState:UIControlStateNormal];

And volumeManager is

@property (strong, nonatomic) IBOutlet MPVolumeView *volumeManager;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top