문제

I have a view with many rotating and moving columns. To column i add UIView named element with image and title. For full understanding this image image

My problem strange for me. I add to element tap gesture

gestureTap = [[UITapGestureRecognizer alloc] action:@selector(panoramaTap)];
    [gestureTap setNumberOfTapsRequired:1];

    [gestureTap setNumberOfTouchesRequired:1];
    [gestureTap setDelegate:self];
    [self addGestureRecognizer:gestureTap];

But panoramaTap: work only in some area, which change after moving.

In app like this on iPad all work fine. What is affecting on gesture?

도움이 되었습니까?

해결책

[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(panoramaTap:)];

make sure that your code is exactly like this. target should be self and after paranomaTap in selector there should be ":" character just like shown above.

And the problem is, tap is recognised when both the touchDown position on UIVIEW is same as touchUP position on that view.Since your view is moving, both positions change.So it wont recognise that tap event

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top