How can I nest a UIScrollView inside a UIScrollView, so that the user can scroll the inner UIScrollView?(如何在 UIScrollView 中嵌套 UIScrollView,以便用户可以滚动内部 UIScrollView?)
问题描述
我还没有尝试过,但我认为一旦我知道用户想要在子滚动视图中滚动,我就必须禁用父滚动视图的滚动,对吧?
I haven't tried that yet, but I assume that I would have to disable scrolling of the parent scroll view as soon as I know that the user will want to scroll in the child scroll view, right?
两个滚动视图都是水平滚动的.
Both scroll views are scrolling horizontal.
如何暂时禁用父级的滚动检测?还是有其他方法?
How could I disable scrolling detection of the parent temporarily? Or is there some other way?
推荐答案
UIScrollView 有一个名为 scrollEnabled
的属性,您可以将其设置为 NO
以禁用父级中的滚动滚动视图.
UIScrollView has a property called scrollEnabled
, which you can set to NO
to disable scrolling in your parent scroll view.
我还没有尝试过,但您可能会发现它做正确的事,即内部滚动视图滚动直到它不能再滚动,此时外部滚动视图滚动.
I haven't tried it yet, but you may just find that it Does The Right Thing, i.e., the inner scroll view scrolls until it can't scroll any more, at which point the outer scroll view scrolls.
这篇关于如何在 UIScrollView 中嵌套 UIScrollView,以便用户可以滚动内部 UIScrollView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 UIScrollView 中嵌套 UIScrollView,以便用户可
基础教程推荐
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01