阻止ScrollView在特定区域滚动?
我希望你能帮助我...
我有一个滚动视图(UIScrollview),其中包含一个内容视图(UiView)。
在内容视图内我有一个水平滑块。我的问题是,如果用户在滑块旁边滑动并尝试点击滑块,滚动视图就会滚动。如果可能的话,我想扩大滑块的区域,或者只是禁用滚动视图的特定部分的滚动。
这可能吗?如果可以,如何实现?
谢谢...
I hope you can help me...
I have a scrollview (UIScrollview) that contains a contentView (UiView).
Inside the contentview I have a Horizontal slider. My problem is that if the user swipes just next to the slider, trying to hit the slider, the scrollview scrolls. I would like to enlarge the area of the slider if possible, or just disable scrolling for a certain part of the scroll view.
Is this possible, and if yes, how?
Thanks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要查看以下属性来自定义滚动视图的外观:
或者如果这不符合您的口味:您可以子类化 UIScrollView ,当自定义滑块接收触摸时,在转换它们中读取它们并在 UIScrollView 上调用 setContentOffset 。在我看来,这似乎是一项艰巨的任务,但奖励很少,我只会坚持默认的行为/外观。
You need to look at the following properties for customizing the look of a scroll view:
Or if this isn't to your taste: You could subclass UIScrollView and when the custom slider receives touches, read them in transform them and call setContentOffset on the UIScrollView. In my opinion that seems like a big task for very little reward and I'd just stick with the default behaviour/look.