0
클릭하면 UIButton
이 왼쪽으로 변형 되려고하고 있는데, 동시에 축소하려고합니다. 다음 코드를 시도하고 왼쪽으로 변환하지만 단추를 축소하는 방법을 모르겠습니다. 어떻게 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)
})
}
감사합니다. 하지만 두 번 클릭하면 화면에서 사라집니다. 스크린에서 나가는 것을 어떻게 막을 수 있습니까? – StevenR
버튼이 75 포인트만큼 왼쪽으로 이동할 때마다'button.frame.origin.x - 75'를 체크하여 0보다 큰지 확인해야합니다. – gabbler