Horizontal Scrolling when Scrollview inside Scrollview - iphone

I have two horizontal paging scroll views where a one is smaller and a subview of the the other. Is there a setup that consistently allows a horizontal drag to move the outer scroll view when there is no more paging to do in the inner scroll view?

Apparently you have to turn off the rubberbanding in the inner scroll view for this to work properly.

Related

unnecessary horizontal scroll xcode

I have implemented a UIScrollView, which has a content view. Content view contains the UILables to display texts. Eventhough i have the necessary vertical scrollview for long paragrpahs, there is an unnecessary horizontal scrollview as well.
In this case, position the control view horizontally center in container. This should prevent the horizontal scroll.

UIScrollView in iOS doesn't response scroll to top

I have two UIScrollViews, one is horizental, the other is like page on the horizontal view. I want to click the status bar and have the vertical scrollView scroll to the top, but it doesn't work.
I searched for some information that said I must set UIScrollView.scrollsToTop=NO, but it doesn't work. Could somebody tell me why?
The scroll view only scrolls to the top if there is a single scroll view present with the scrollsToTop property set to YES.
Make sure it's set to NO on your horizontal scroll view and all the child, vertical scroll views contained within. Then, using the horizontal scroll view's delegate, as one vertical scroll view leaves the visible area, toggle the property to NO and toggle the incoming vertical scroll view's property to YES.

Two UIScrollView's on top of each other?

I'm working on a iphone game, and part of it includes a section where you scroll horizontally through a list of images (which have transparent backgrounds).
but I also want to be able to vertically scroll and change the background image, without the image in the horizontal scroll view changing.
I have the horizontal scrollview working now, and I've placed a second scrollview behind it for the vertical scrollview, but obviously the vertical scrollview doesn't catch the up/down swipes.
Is there some way to push vertical swipes through to the second scrollview, but catch the horizontal swipes on the first?
Mike
IF you implement the scrollViewDidScroll Delegate for the first scroll view and catch the scroll offset, you can pass the same to the second scroll and control how the offset moves on the second scroll.

UIScrollView within UIScrollView

I have got a hierarchy where UIScrollviews exist within each other.
How may I redirect swipe events for a certain area to an inner scrollview?
If you set your UIScrollViews to only be scrollable in one axis or the other (ie, set their contentSize property appropriately for this. To have a view only be scrollable vertically, set its contentSize.width value to be the same as its bounds.size.width). then they should just work, assuming that no two views scroll in the same axis. Usually, you'll have the 'child' views scroll vertically, and the parent view scroll horizontally.
If it's at all possible, you should redesign to avoid this. Safari handles this kind of situation, i.e. iframes and textareas, by having the embedded view scroll with two fingers. This isn't very discoverable, but it's better than the alternative, which would be even more frustrating. If an embedded view were just barely onscreen, an attempt to scroll the outer view could instead scroll the inner view, but not display much of anything; it would just appear to be non-responsive.
That said, If you still want to do this, try setting the outer scroll view's canCancelContentTouches to NO. This should prevent the outer view from scrolling when a touch begins in the inner view. Getting Safari-style two finger scrolling would probably involve subclassing UIScrollView and implementing the -touchesShouldBegin:withEvent:inContentView: method.

Is there a way to achieve parallel scrolling of two tableview?

Let's say, i have two tableview inside a scrollview. After i scrolled up & down tableview1, and then touch and swipe to scroll the scrollview horizontally to tableview2, i want tableview2 to have the same vertical (up & down) position as tableview1. is there any way to achieve that?
thanks
You can put code in the UITableViews' viewWillDisplay: methods that grabs the other table view's scroll position (called a "content offset" in scroll view parlance) and calls setContentOffset:animated:. This way, whenever either scroll view will appear on the screen, it will automatically scroll to the other view's position.