Quote:
Originally Posted by cnmeyer1980
Hi everyone,
I've been trying for ages, searching the web and trying to find a tutorial on how to incorporate a UIScrollView into a tab nav based application.
I have a source file i've put together, but it doesn't seem to work.
Could anyone help if i send the source code?
Many thanks in advance.
Chris
|
I've got this working on my app currently. I'm a newbie, but, what I've found is that I have to set the size of the UIScrollView to the size of the visible and usable remaining area of your view (above the tab bar and below the navigation bar (if applicable)) within Interface Builder, then in your viewDidLoad or viewDidAppear method's, set your content size to the scroll size required. If you set your scroll size to larger than your visible/usable area from interface builder, it won't work.
Code:
[scrollView1 setBackgroundColor:[UIColor clearColor]];
[scrollView1 setCanCancelContentTouches:NO];
scrollView1.indicatorStyle = UIScrollViewIndicatorStyleDefault;
scrollView1.clipsToBounds = YES; // default is NO, we want to restrict drawing within our scrollview
scrollView1.scrollEnabled = YES;
scrollView1.pagingEnabled = NO;
[scrollView1 setContentSize:CGSizeMake(320.0, 950.0)];