2010-09-15 93 views
4

我確實有一個視圖,它有一個UIScrollView,在它上面有一個顯示一些文本的視圖。 當用戶在包含文本的視圖上滑動時,UIScrollView將不會滾動。如何使這個視圖透明,以便將滑動手勢傳遞給UIScrollView。從另一個視圖向UIScrollView傳遞滾動手勢

感謝

回答

2

您可以只設置

myTextView.userInteractionEnabled = NO; 

或者,如果您要創建與Interface Builder中你的看法,有一個複選框有所謂的「用戶交互啓用」,只是取消選中。

+0

這將禁用該文本視圖中的按鈕。它有一個幻燈片播放/停止按鈕。 – mukaissi 2010-09-15 22:47:30

-1

在自定義視圖的-XouxX:withEvent:方法中,調用其超級方法來轉發觸摸事件。

例如:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 
{ 
    // forward touchesBegan to super class 
    [super touchesBegan:touches withEvent:event]; 

    ... 
    // process touchesBegan for this view 
} 

做touchesMoved,touchesEnded和touchesCancelled同樣的事情。

0

退房的UIView hitTest Method

返回視圖層次結構(包括自身),其中包含一個指定點的接收器最遠的後裔。

​​
相關問題