ios - 使用动画显示和隐藏按钮

标签 ios objective-c core-animation

我该如何让这个 UIButton 从 View 中慢慢消失?我正在寻找的动画会使按钮看起来像它的 widthrawing 向下。我应该使用 Core Animation 吗?我是 iPhone 开发的新手,但这似乎是可行的

enter image description here

最佳答案

似乎您只是想通过使用 UIView 的类方法 animateWithDuration:animations:

为框架(或准确地说,中心位置)的变化设置动画
[UIView animateWithDuration:<some duration> animations:^{
    myButton.center = (CGPoint){myButton.center.x, CGRectGetMaxY(self.view.frame) + (CGRectGetHeight(myButton.bounds)/2.0)};
}];

CoreAnimation 对于这个简单的操作来说太过分了。

关于ios - 使用动画显示和隐藏按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18179481/

相关文章:

ios - 如何使 TabBarController 的 ViewController 上的 UIButton 使用户返回到 Swift 中最后选择的 TabBarViewController(不是当前的)

ios - Microsoft Band Accelerometer更新时间间隔无法更改(iOS SDK)

iOS - 按下按钮时对象会产生动画,但以编程方式调用方法时不会产生动画

ios - drawViewHierarchyInRect :afterScreenUpdates: delays other animations

iOS 按钮文本本地化 - 你必须做整个 xib 文件吗?

iphone - iOS 5 上 NSDictionary 中出现奇怪的重复键,而 iOS 6 上则不然

ios - 当我尝试运行我的应用程序时 Xcode 6.1 崩溃

objective-c - 如何以编程方式为 NSTabView 添加绑定(bind)?

ios - 将 WKInterfaceController 滚动回顶部

ios - 如何使用默认的 iOS 7 UI 动画曲线