0
버튼을 누르고있는 동안이 방법을 반복적으로 실행할 수 있습니까? 이렇게하면 버튼을 누르고있는 동안 이미지가 위로 이동합니다.코코아 터치 - 버튼 누르기
-(IBAction)thrustButton{ //moves ship foward
yCoordinate = yCoordinate - 2;
[UIView beginAnimations:@"slide-up" context:NULL];
shipImageView.center = CGPointMake(xCoordinate,yCoordinate); // change this to somewhere else you want.
[UIView commitAnimations];
}
고마워요!
[yourButton addTarget:self action:@selector(doneButtonPressed) forControlEvents:UIControlEventTouchDown];
[yourButton addTarget:self action:@selector(doneButtonReleased) forControlEvents:UIControlEventTouchUpInside];
를 다음 2 가지 방법 처리 :