iPad/iPhone double click problem

前端 未结 3 707
星月不相逢
星月不相逢 2021-02-04 21:51

I\'m having a very similar problem to iPad/iPhone hover problem causes the user to double click a link where a user tapping a link has to tap twice to actually go to it.

<
3条回答
  •  遇见更好的自我
    2021-02-04 22:54

    If your content is in a UIScrollView, you can (or may already have) implemented the UIScrollViewDelegate; which contains the following method:

    -(void)scrollViewDidScroll: (UIScrollView*)scrollView
    

    If you use this, and get the following:

    float offset = scrollView.contentOffset.y;
    
    if (offset > 0)
        // then we have started to scroll
    

    If you use this condition in conjunction with detecting the number of taps/presses currently on the screen, (ie, just one in your case) then ignore any fired calls (if >1 taps) that may occur when a link is tapped.

    Hope this helps!

提交回复
热议问题