In iOS 8 there is a problem or a feature. When MPVolumeView is shown, it\'s being animated, like expanding from 0 to it\'s width. How can I fix that behavior? There was no such
One possible way to remove this behavior is to subclass MPVolumeView and perform some additional work after [super layoutSubviews]
.
- (void)layoutSubviews
{
[super layoutSubviews];
[self cg_recursiveRemoveAnimationsOnView:self];
}
- (void)cg_recursiveRemoveAnimationsOnView:(UIView *)view
{
[view.layer removeAllAnimations];
for (UIView *subview in view.subviews) {
[self cg_recursiveRemoveAnimationsOnView:subview];
}
}
This removes all inserted animations. So be sure that is what you want, since this is quite the overkill. One could also just remove the position
and bounds
animations (see removeAnimationForKey:
).