I use a standard gradient overlay (done in photoshop) to make buttons look nicer in my app. I added an Airplay button, but the aesthetics are not matching.
I created a custom method which works perfectly...
-(void)airplayIcon:(CGRect)rect {
UIView *aiplayView = [[UIView alloc] initWithFrame:self.bounds];
aiplayView.clipsToBounds = true;
aiplayView.backgroundColor = [UIColor clearColor];
[self addSubview:aiplayView];
MPVolumeView *airplayVolume = [[MPVolumeView alloc] initWithFrame:aiplayView.bounds];
airplayVolume.showsVolumeSlider = false;
[aiplayView addSubview:airplayVolume];
for (UIButton *button in airplayVolume.subviews) {
[button setFrame:self.bounds];
if ([button isKindOfClass:[UIButton class]]) {
[button setImage:[UIImage imageNamed:@"normal.png"] forState:UIControlStateNormal];
[button setImage:[UIImage imageNamed:@"selected.png"] forState:UIControlStateSelected];
[button sizeToFit];
}
}
}