I’m creating a 30-35 page comic book and just have been hitting roadblock after roadblock in my journey.
1) I know that I have to create 30-35 different UIScrollviews with the images inside. The problem there is that the autorotation automatically throws half the image off the screen
2) i have no idea where to place this code
Code:
UIScrollView* containerView = [[UIScrollView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
containerView.backgroundColor = [UIColor blackColor];
containerView.scrollEnabled = YES;
containerView.pagingEnabled = YES;
containerView.bounces = NO;
containerView.directionalLockEnabled = YES;
self.view = containerView;
3) I’m thinking of paying a developer to just create this basic foundation and then explaining what he did so that i can add future images to the same foundation.
is there any place i can go to, to talk to someone over the phone or in person to work on coding this project. the deadline is soon and i’m just fustrated with the whole thing…
thanks
Hey, it seems like you’re stressed about this, but I honestly just went through a lot of these same hoops. Check out this awesome Apple Sample: Scrolling. That should help you out a lot.
A quick note about scrollviews: I don’t quite understand what you mean by 30-35 UIScrollViews. That shouldn’t be needed. In my app we have a UIViewController which has 1 UIScrollView inside. Then we just add photos to that and things work. The above sample should clear things up. [imageScrollView addSubview:imageView]; makes adding images to the scrollview simple.
If you set up your view structure in IB, things should work pretty smoothly.
About the half-paging issue an autorotation, it’s a bug that I ran into and I spent a lot of time fixing it. I still don’t know why it happens, but the solution is to create a layer of properties within your UIViewController that expose where the scrollview is at an time. You then just need to check against where you expect it to be and adjust when it’s not the same. As always, lay out a complete layer for doing this, don’t just fix it in one place.
I’m happy to post more if more is needed.