4
我試圖實現這個很酷的功能,應用程序加載之後的徽標稍微向上移動,登錄視圖出現。問題是,當我使用此代碼:iOS Swift動畫 - 將圖像移動到新位置
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
UIView.animateWithDuration(2, animations: {
var newCenter = self.logoImage.center
newCenter.y -= 100
self.logoImage.center = newCenter
}, completion: { finished in
println("Basket doors opened!")
})
}
標誌移動到從我希望它移動到的地方的發源地。所以在這個例子中,logo已經出現(y-100),然後移動到原點X,Y。
試着把它放在viewDidAppear中。 – AdamPro13 2014-09-23 21:14:17