문제

I have a main menu with a list of buttons. On the bottom I have a bar that the user can flick up to the top via a scrollview. Whats underneath that bar however is a uiwebview. So when the user tries to scroll in the uiwebview, the bar and webview just snaps back down. Also, the uibuttons won't work when the bar is down because the scrollview is sitting over them. How do i make the scroll only work when the user touches the bar and make the buttons on my menu work when the bar is down?

Thanks in Advance!

도움이 되었습니까?

해결책

Where you want the scrollView to "work" (maybe when user flicks the bar up) have the following code:

scrollView.userInteractionEnabled = YES;

and wherever you don't want the scrollView to register any user actions (like when the bar is down) just do the opposite and set it to NO.

다른 팁

So if I understand correctly, you want the UIScrollView to respond to touches in only a certain part of the frame (the bar)?

I would suggest taking a look at one of my previous answers to a similar problem, here.

In particular, see:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top