iphone - Disable UIScrollView vertical scrolling with NavigationBar -
So I have seen many other posts on it, and I think I have tried almost all. I do not want this to be a duplicate, but I can not find a solution to my problem. I have a setup like this:
When I go to my scroll, see the controller, I can only do it on the right page, but I can also move images around the vertical. I think there is something to do to reduce ScrollView frames from the navigation bar, but still setting the frame in the frame screen size. View the Scroll View How do I stop any vertical scrolling on the controller? my. I am below:
- (zero) viewDidoadload {[Super Viewedload]; // Make an additional setup after loading the view Self.navigationController.navigationBarHidden = No; I = 0; _PhotoBundle = [[NSBundle Main Bundle] Path: ForResourcesOfType: @ ".Jpg" In Directory: @ "dog_text"]; _PhotoArray = [[NSMutableArray alloc] initWithCapacity: _PhotoBundle.count]; (Nifty Fingerbuff in NSString * Path) [[Photo array add object: [UIImage imageWithContentsOfFile: Path]]; } (Int x = 0; x & lt; _PhotoArray.count; x ++) {CGFF frame; Frame.origin.x = self.mainScroll.frame.size.width * x; Frame.origin.y = 0; Frame. Size = self.mainScroll.frame.size; UIImage * nextImg = [[UIImage alloc] init]; NextImg = [photo array object atxxx]; UIImageView * nextIV = [[UIImageView alloc] initWithFrame: frame]; [Next V set image: Next Img]; [Self. Add MyScroll ScrollSubview: NextIv]; // NSLog (@ "pass% d", x); } Self.mainScroll.contentSize = CGSizeMake (self.mainScroll.frame.size.width * _PhotoArray.count, self.mainScroll.frame.size.height); } Thanks a lot!
Then I found a post that explained it completely:
When I change my
CGSizeMake (auto-menscroll.fr. size.width * _PhotoArray.count), self.minescroll.fr.image.height); to
CGSizeMake (self.mainScroll.frame.size.width * _PhotoArray.count, 1.0); This makes ContentSize from being larger than the border ... I have read everything but did not fully understand. I hope that any help associated with this will help ...
Comments
Post a Comment