绕过从 uiwebview 到父视图的滚动事件

发布于 2024-12-03 03:28:21 字数 192 浏览 0 评论 0原文

我遇到了有关滚动事件的问题

在将子视图 UIWebView 添加到表格单元格后,

[cell.contentView addSubview:webview];

如果在webview内垂直滚动,webview正在滚动,父表格单元格是静态的,我想绕过父视图(单元格)的滚动事件并让表格垂直滚动

如何做这项工作?

I have a problem about scroll event

after I added a subview UIWebView to a table cell

[cell.contentView addSubview:webview];

if scroll vertical inside webview, the webview is scrolling, the parent table cell is static, I want to bypass the scrolling event to parent view(cell) and let table scroll vertical

How to do the job?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

檐上三寸雪 2024-12-10 03:28:21

如果你只是需要Web View来显示内容;并且不以任何方式处理用户交互,您只需为 webview 禁用UserInteraction;

webView.userInteractionEnabled=NO;

这会将所有用户交互传递到父视图,在您的情况下,父视图将是单元格。

If you simply need the Web View to display content; and not handle user interactions in any way, you simply need to disableUserInteraction for the webview;

webView.userInteractionEnabled=NO;

This will pass any user interactions down to the parent view, which in your case will be the cell.

计㈡愣 2024-12-10 03:28:21

尝试禁用 webview 的滚动

for (id subview in mWebView.subviews)
    if ([[subview class] isSubclassOfClass: [UIScrollView class]])
        ((UIScrollView *)subview).scrollEnabled= NO;

Try disabling scrolling of webview

for (id subview in mWebView.subviews)
    if ([[subview class] isSubclassOfClass: [UIScrollView class]])
        ((UIScrollView *)subview).scrollEnabled= NO;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文