Reputation: 7900
I am using this code to change the Volume bar - MPVolumeView
- in IOS 7 :
UIImage *minImage = [[UIImage imageNamed:@"VolumeBarBlueFull.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 4, 0, 4)];
UIImage *maxImage = [UIImage imageNamed:@"VolumeBarGreyEmpty.png"];
UIImage *thumbImage = [UIImage imageNamed:@"VolumeThumb.png"];
[[MPVolumeView appearance] setMinimumVolumeSliderImage:minImage forState:UIControlStateNormal];
[[MPVolumeView appearance] setMaximumVolumeSliderImage:maxImage forState:UIControlStateNormal];
[[MPVolumeView appearance] setVolumeThumbImage:thumbImage forState:UIControlStateNormal];
[[MPVolumeView appearance] setVolumeThumbImage:thumbImage forState:UIControlStateHighlighted];
This is the images:
And i noticed that if i want to change the MPVolumeView
width with setFrame
method to smaller width the volume bar stay in the same size.
but if remove the code above from my code(return to normal MPVolumeView
) the width changes perfect.
Any idea what can be the issue?
Upvotes: 1
Views: 696
Reputation: 54
Change
UIImage *maxImage = [UIImage imageNamed:@"VolumeBarGreyEmpty.png"];
Into:
UIImage *maxImage = [[UIImage imageNamed:@"VolumeBarGreyEmpty.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 4, 0, 4)];
Just as you did with minImage.
Upvotes: 1