저는 UIPanGestureRecognizer를 사용하여 사용자가 그린 경로를 따라 객체를 이동합니다. 그러나이 객체는 애니메이션을 적용하고 있으며 애니메이션 작업 중에이 객체와 상호 작용해야합니다. 가능한가? 이미 UIViewAnimationOptionAllowUserInteraction
을 사용하려고하지만 결과는 없습니다.iOS - UIPanGestureRecognizer : 애니메이션 도중 끌기
답변
예 가능합니다. 그러나 CABasicAnimation
을 사용하여 객체에 애니메이션을 적용하고 UIView animationWith...
을 사용하지 말고 UIPanGestureRecognizer
을 객체에 추가합니다. 그래서 몇 가지 예제 코드 :
// Configure the animation and add it to the layer.
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"position"];
anim.fromValue = ...
anim.duration = ...
[view.layer addAnimation:anim forKey:@"some key"];
// Then add the UIPanGestureRecognizer to that view.
어떻게하면됩니까? 이제는 UIView 애니메이션을 사용하고 객체 프레임을 이동하지만 CABasicAnimation을 사용하면 어떻게 동일한 작업을 수행 할 수 있습니까? –
그래서 물체가 움직이며 사용자가 그것을 두 드렸을 때 움직이지 않고 그의 팬 제스처를 따라야합니까? 너가 원하는게 그거야? – Masa
그래, 그게 내가 원하는거야? @iMasa –
- 1. iOS - 애니메이션 도중 요소를 드래그하는 방법
- 2. ios UIPanGestureRecognizer 포인터 위치
- 3. 애니메이션 도중 처리를 수행하는 방법
- 4. 애니메이션 도중 Z 순서 변경
- 5. 애니메이션 도중 버튼을 활성화하는 방법
- 6. 애니메이션 도중 UIView 크기 조절
- 7. 애니메이션 끌기 일시 중지 하시겠습니까?
- 8. UIPanGestureRecognizer 내가 가진
- 9. 애니메이션 도중 UIView touchesbegan이 응답하지 않습니다.
- 10. 애니메이션 도중 직사각형 대 이미지 성능
- 11. 애니메이션 도중 CAShapeLayer 마스크 정적 유지
- 12. 애니메이션 도중 하위 뷰가 올바르게 배치되지 않았습니다.
- 13. JQuery Animate : 애니메이션 도중 지주의 위치 변경
- 14. 애니메이션 도중 UIButton이 상호 작용하지 않습니다.
- 15. 애니메이션 도중 UILabel을 어떻게자를 수 있습니까?
- 16. UIPanGestureRecognizer distance
- 17. CABasicAnimation UIPanGestureRecognizer
- 18. UIPageViewController가있는 UIPanGestureRecognizer
- 19. MKMapView의 UIPanGestureRecognizer?
- 20. Windows 7 애니메이션 마우스 끌기 이벤트
- 21. Android - 애니메이션 만들기 '잠그기 위해 끌기'
- 22. UITableView 끌기
- 23. UIScrollView에서 UIButtons 끌기?
- 24. iOS 5 용 "끌기"가있는 TabBar
- 25. iPad의 UIPanGestureRecognizer 문제
- 26. UIPanGestureRecognizer 동작 제한
- 27. UILongPressGestureRecognizer 및 UIPanGestureRecognizer 결합
- 28. UIPanGestureRecognizer 및 UITapGestureRecognizer 동시에
- 29. UIPanGestureRecognizer 및 2 UISwipeGestureRecognizers
- 30. iOS 애니메이션 스플래시 화면
http://stackoverflow.com/a/5572717/1059705 & http://stackoverflow.com/q/8340329/1059705이 당신에게 – Bala
도움이 될 수 http://developer.apple .com/library/ios/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html # // apple_ref/doc/c_ref/UIViewAnimationOptionAllowUserInteraction – Bala