【发布时间】:2015-01-04 08:16:24
【问题描述】:
我试图在单击时改变我的UIButton,并且我希望它同时缩小。我试过下面的代码,它确实向左变换,但我不知道如何缩小按钮。我怎样才能缩小和转换UIButton。
@IBAction func joinCircleButton(sender: AnyObject) {
let button = sender as UIButton
UIView.animateWithDuration(1.0, animations:{
button.frame = CGRectMake(button.frame.origin.x - 75, button.frame.origin.y,button.frame.size.width, button.frame.size.height)
})
}
【问题讨论】:
标签: ios animation uibutton animatewithduration