iphone - How to scroll the content without scrolling the image in the background using UIScrollView? -
I am trying to scroll through the contents without scrolling the image in the background by using UIScrollView.
I am setting up the file owner view (with the help of IB) and clicking on the scroll view (the image view is the child of the scroll view). I've made the image height at 960 pixels.
I have also set the scrolling content size in the UIView
- (zero) viewDidLoad {UIScrollView * tempScrollView's vierController = (UIScrollView *) self.view; TempScrollView.contentSize = CGSizeMake (320, 960); }
My problem is that the image appears only with content.
I have tried to move the settings to the deedload, but struggles to do the scrolling task
I have also tried to change the location of the image and instead of scrolling it Placed under VIEW (the way Scroll View is a child of VIEW), but as a result, app braking (termination error).
Any advice would be appreciated.
The easiest (and the right way) to set the background image in your UIScrollView
UIImage * img = [UIImage imageNamed: @ "image.png"]; [ScrollView setBackgroundColor: [UIColor colorWithPatternImage: img]];
Comments
Post a Comment