0

all, I'm a newbie on ios development.

I want to implement a right swipe gesture to UIWebView, which should have the action specified by me. However, the when the web page is too large that causes the UIWebView has a scroll bar, then my custom left swipe gesture doesn't work at all. In this case, when I swipe right, then the scroll bar will move, instead of triggering my specified action. Is there any way to disable the scroll bar moving action when I swipe right?

Hope my question is clear to you ... Thanks in advance.

4

2 回答 2

0

you can disable the whole scroll in the UIWebView like this

UIScrollView *scroll = [[webView subviews] lastObject];

if([scroll isKindOfClass:[UIScrollView class]])
{
    scroll = (UIScrollView*)scroll;
    [scroll setScrollEnabled:NO];
}
于 2012-05-14T07:40:39.593 回答
0

要么在 webview 上添加一个透明视图,要么创建 UIWebView 的子类并覆盖 touchmethods。

于 2012-05-13T23:32:22.247 回答