I have a really big problem with UIScrollView. To make sure that this is not my actual project, I created a new project, only for iPhone, for iOS 6 and 7. I have auto-detection disabled .
- I created a tab bar project
- I created a view controller, embedded it in the navigation controller, and connected it as a tab bar item # 0
- I put a UIScrollView in my opinion.
- I have enabled scrolling in a custom UIViewController created for this view.
- I synthesized my IBOutlet and assigned a delegate to myself. I am also an implemented delegate in .h
Here is my code (ViewDidLoad):
self.scrollView.delegate = self; [self.scrollView setScrollEnabled:YES]; [self.scrollView setContentSize:CGSizeMake(self.view.frame.size.width, 20000)]; NSLog(@"contentSize width %f", self.scrollView.contentSize.width); NSLog(@"contentSize height %f", self.scrollView.contentSize.height); NSLog(@"%@", NSStringFromCGAffineTransform(self.scrollView.transform));
It returns me "contentSize width 20000.000000", "contentSize height 0.000000" and "[1, 0, 0, 1, 0, 0]". It scrolls left-right, where it should scroll up and down
Please, help!
ios objective-c iphone autolayout uiscrollview
anthoprotic
source share