Reputation: 325
I am currently using MPVolume to stream audio from my app to Apple TV. MPVolume has route button and I want to expand the touching area of this.
UIButton *button;
for (id object in self.volumeView.subviews) {
if ([object isKindOfClass:[UIButton class]]) {
button = object;
}
}
I use snippet code above to catch up this button and set the new frame for it but it does not work.
Upvotes: 1
Views: 262
Reputation: 222
You can subclass MPVolumeView, override layoutSubviews method, on this method, find the Button and resize it.
- (void)layoutSubviews {
[super layoutSubviews];
for (UIView *view in self.subviews) {
if (view.class == NSClassFromString(@"MPButton")){
//Do something here
}
}
}
Upvotes: 1