I’m doing an iphone app where I’ve severals UILabels, UITextfields and UIButtons. I need show them in a screen with more 480px of height, so I’ve introducing them into an UIView. Later, I’ve created an UIScroller for show them.
Its struct in interface builder is:
- View controller
- —> View (it isn’t resizable and may be obligatory)
- —> Scrollview
- —> View
- —> Labels
- —> TextFields
- —> View
- —> Scrollview
- —> View (it isn’t resizable and may be obligatory)
I’ve set UIScrollView contentsize’s and UIView frame below “User Defined Runtine Attributes” in “Identity Inspector” (on Interface Builder) and show them in Console Log when app runs. Seems be ok, but UIScrollView always back to top when I scroll it down and its scrolls weren’t shown.
I’ve search a lot in this forum I haven’t found any solution.
Can anybody help me? Thanks!
Edit: I added on my code this to show their defined values (uploadView is the view in scrollView)
- (void) viewDidLoad {
//....
[super viewDidLoad];
CGSize size = scrollView.contentSize;
CGRect viewrect = uploadView.frame;
CGSize viewsize = viewrect.size;
NSLog (@"size of scrollView: height= %f and width= %f", size.height, size.width);
NSLog (@"size of uploadView: height= %f and width= %f", viewsize.height, viewsize.width);
}
The outputs are:
size of scrollview: height= 600.000000 and width= 320.0000000
size of uploadview: height= 600.000000 and width= 320.0000000
Well, I’ve continued searching for any answer and I’ve found the solution.
I can't get my scrollview to scroll correctly with objects such as 'round rect buttons' or labels
Sum up, using viewDidAppear method