I'm sorry, I don't know a better title.
The issue:
I've got one UITableViewCell
with auto layout, the default height in the nib is 300. 300 is the correct size for one of my UIViewControllers
.
I'm using a UINavigationController
inside a container view, beneath the container view is a UIView
called FooterView
.
In the container view are two UIViewControllers
; VC1
and VC2
.
When I'm pushing VC2
onto VC1
, I'm also changing the height of FooterView with it's NSLayoutConstraint
height constant.
I'm doing this inside a animation block, with [self.view setNeedsLayout];
I'm setting the height for the UITableViewCell
inside VC2
to 200.
Now the problem is that when I'm transitioning from VC1
to VC2
you also see the UITableViewCell
being animated from 300 to 200.
My guess is that this is because of the animation block. I've tested it by removing the animation and the cell didn't animate (as expected).
Is there any way to stop this animation chaining?
I'm sorry if I'm not clear enough.
All I needed to do was to override layoutSubviews
inside the cell:
- (void)layoutSubviews
{
[UIView performWithoutAnimation:^{
[super layoutSubviews];
[self.contentView layoutIfNeeded];
_shadowView.layer.shadowPath = [UIBezierPath bezierPathWithRect:_shadowView.bounds].CGPath;
}];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With