【发布时间】:2014-09-22 20:54:52
【问题描述】:
我正在尝试使用动画来增加标签高度,但是动画会导致标签首先从中心扩展,然后在正确的 y 点处跳转。这看起来很可怕。我只想扩大底部。
[UIView animateWithDuration:0.5 delay:0.0f options:UIViewAnimationOptionTransitionNone animations:^{
[self.about increaseHeightFromTopLeft:deltaHeight];
[self.scrollView increaseContentHeight];
} completion:nil];
- (void)increaseHeightFromTopLeft:(CGFloat ) increased {
CGRect newFrame = CGRectMake(self.originX, self.originY, self.frameWidth, self.frameHeight + increased);
self.frame = newFrame;
}
标签叫做about,你可以在这里看到动画的视频。 https://www.youtube.com/watch?v=DcqktIZ9moY&feature=youtu.be
【问题讨论】:
-
在我看来,需要动画的是下面的按钮。标签的文本本身不是动画属性。标签可以开始很大,部分被它们共享的子视图上的那些按钮覆盖,然后您更改标签中的文本并滑动按钮
-
虽然这不是我想要的答案,但我仍然按照您的建议进行操作,而且看起来不错。谢谢