【发布时间】:2015-10-29 20:06:34
【问题描述】:
目前我正在加载一个新的 .Xib 类 CreateAnAccount: UIView form a button press on another view。
目前它会立即切换到 Xib,这很棒,但是有没有办法对此进行动画处理?下面是按钮中的代码。
@IBAction func createAnAccount(sender: AnyObject) {
let createAnAccountView = NSBundle.mainBundle().loadNibNamed("CreateAnAccount", owner: self, options: nil)[0] as! CreateAnAccount
createAnAccountView.frame = CGRectMake(0, 0, UIScreen.mainScreen().applicationFrame.size.width, UIScreen.mainScreen().applicationFrame.size.height + 20)
createAnAccountView.loginHandler = loginHandler
self.addSubview(createAnAccountView)
println("Create An Account Pressed")
}
【问题讨论】:
-
这是在 Objective C 中,但对你来说是一个好的开始:stackoverflow.com/questions/2337408/addsubview-animation
-
在iOS中有很多动画视图,首先需要了解你的笔尖需要什么类型的动画。