开发者

Preventing ScrollView from scrolling in certain area?

开发者 https://www.devze.com 2023-02-21 18:06 出处:网络
I hope you can help me... I have a scrollview (UIScrollview) that contains a contentView (UiView). Inside the contentview I have a Horizontal sl开发者_开发问答ider. My problem is that if the user sw

I hope you can help me...

I have a scrollview (UIScrollview) that contains a contentView (UiView).

Inside the contentview I have a Horizontal sl开发者_开发问答ider. 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...


You need to look at the following properties for customizing the look of a scroll view:

indicatorStyle
scrollIndicatorInsets

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号