Two UIScrollView's on top of each other? - iphone

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.

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.

Horizontal Scrolling when Scrollview inside Scrollview

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.

implement UIScrollview on a particular area of screen?

i am creating an app which has two UIImageViews at top and bottom of the screen and few customs buttons in between them which i am using in a UIScrollview so that user can scroll through them while the two images remain on top & bottom as they are.But when i use the scrollview the buttons scroll over the two UIimageview instead of just scrolling between them or hiding behind them as users scroll down..how can i make the UIImagviews remain on top of the buttons in UIScrollview??
I assume that you use the Interface Builder...
Make sure that:
The frame of the scroll view is between the image view
The Clip subviews of the scroll view is checked
The image views appear after the scroll view in the views hierarchy (if not then you can just drag them inside the hierarchy)

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.