How to scroll the content without scrolling the image in the background using UIScrollView ?

Posted by Raymond Choong on Stack Overflow See other posts from Stack Overflow or by Raymond Choong
Published on 2010-05-18T08:09:06Z Indexed on 2010/05/18 8:10 UTC
Read the original article Hit count: 193

Filed under:
|

I am trying to scroll the content without scrolling the image in the background using UIScrollView.

I am using IB and setting the FileOwner View to point to the Scroll View (Image View is a child of the Scroll view). I have made the image height to be 960 pixels.

I have also set scrolling content size in the vierController that owns this UIView

  • (void)viewDidLoad { UIScrollView *tempScrollView = (UIScrollView *)self.view; tempScrollView.contentSize=CGSizeMake(320, 960); }

My problem is that the Image only appears moves along with the content.

I have tried taking out the settings in viewDidLoad, but the scrolling cease to function.

I have also tried changing the location of the image and have it placed under VIEW instead of Scoll View (by the way Scroll View is a child of VIEW), but that resulted in the app breaking (termination error).

Any advice would be appreciated.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiscrollview