I have a UILabel. I want to revitalize growth and contraction. While resizing, I need the bottom left corner to remain static, so that it always displays directly above the bottom toolbar. I use the following code to enlarge the shortcut:
[UIView animateWithDuration:kAnimationDuration delay:0.0 options:UIViewAnimationCurveEaseInOut
animations:^{
CGFloat lblHeight = 42.0f;
[label setFrame:CGRectMake(0.0,
CGRectGetMaxY(self.view.bounds) - kBottomBarHeight - lblHeight,
CGRectGetMaxX(self.view.bounds),
lblHeight)];
} completion:^(BOOL finished) { }];
and I use the same logic to compress it, except that lblHeight is set to 17.0f
The view grows correctly, but when I try to compress it, the frame change animation is not animated. He peeks into a new size and then brightens up at a new place of origin / location. I need the frame change to be animated. Can anyone see what I'm doing wrong?
source
share