2011-01-13 33 views
-1

我有一个问题。我有一个UISCrollView,当用户触摸scrollView并发送给其他ScrollView或TableView时,我需要获取事件scrollMove。在UIScrollView中检测滚动事件并发送到UITableView或其他UIScrollView

如何将ScrollView中的移动捕捉发送到其他ScrollView或TableView以使这些移动。

对于简单的触摸,我使用touchesBegan,touchesMoved和touchesEnded,但touchesMove在UIScrollView中不起作用,无法将这些移动发送到其他ScrollView或TableView。

我举了一个例子。我需要在secondView scrollView冲突区域中将滚动事件发送到tableView以便在tableView中进行滚动。

 First View 
    ----------------------------- 
    -   -     - 
    -   -     - 
    - T -     - 
    - A -     - 
    - B -     - 
    - L -     - 
    - E -     - 
    - V -     - 
    - I -     - 
    - E -     - 
    - W -     - 
    -   -     - 
    -   -     - 
    ----------------------------- 


    Second View --> ##### is the ScrollView area on tableView FirstView 
    ----------------------------- 
    - -######     - 
    - -######     - 
    - -######     - 
    - -######     - 
    - -######     - 
    - -###### SCROLL  - 
    - -###### VIEW   - 
    - -######     - 
    - -######     - 
    - -######     - 
    - -######     - 
    - -######     - 
    - -######     - 
    ----------------------------- 

    ###### I need scroll on this area and send the moviment to back tableView. 

谢谢你的帮忙!

+1

你提的问题是非常难以理解的内部接触。请重新说明。 – Stunner 2011-01-13 19:50:37

回答

5

HI,

UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapGestureCaptured:)]; 
[scrollView addGestureRecognizer:singleTap];  

和U可以此方法的(Scroll View Touches

- (void)singleTapGestureCaptured:(UITapGestureRecognizer *)touch 
{ 
CGPoint touchPoint=[gesture locationInView:scrollView]; 
} 

复制