【发布时间】:2015-11-12 00:49:05
【问题描述】:
我正在为向下滑动的视图设置动画。在视图中有一个简单的 UIButton。视图和按钮具有固定的宽度和高度(我检查了添加颜色作为背景)。虽然使用时:
[UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
//Slide Down the notification
CGRect notificationsRect = self.notificationContainerView.bounds;
notificationsRect.origin.y = 0;
notificationViewController.view.frame = notificationsRect;
} completion:^(BOOL finished) {
[notificationViewController didMoveToParentViewController:self];
self.currentNotification = notificationViewController;
}];
然后视图完美地向下滑动,预计 UIButton 中的文本会淡入。它开始时非常小,并以正确的字体大小进行动画处理。
如何禁用 UIButton 中文本的动画?
【问题讨论】:
-
我不明白“它开始时非常小并且动画到正确的字体大小。”。 “动画到正确的字体大小”?
-
字体大小从 4pt 开始,然后动画到字体大小 14pt。但是按钮大小不会改变..
-
你能详细介绍一下这个按钮吗?
-
按钮只是一个UIButton,作为notificationContainerView的子视图。我什么也没做。
-
作为一种解决方法,子类化按钮,并用
[UIView performWithoutAnimations: ^ {包装layoutSubviews方法。让我知道这是否有帮助。
标签: ios objective-c uibutton uiviewanimation ios-animations