一旦发生某些事情,我试图将UILabel和UIButton移动到我的应用程序的屏幕上,但是,当我使用动画执行此操作时,它不起作用,并且当动画应该发生时,组件不会移动到屏幕上 . 这是动画的代码:
UIView.animateWithDuration(2) { () -> Void in
self.label.center = CGPointMake(self.view.center.x, self.label.center.y)
self.again.center = CGPointMake(self.view.center.x, self.again.center.y)
}
任何有关此问题的帮助将不胜感激!
2 回答
你应该试试这个 . 使用layoutIfNeeded()将重新定位所有内容 .
试试这个!