I created a view controller with a navigation bar on top, a tab bar at the bottom, and nothing but a UIScrollView
that occupies all the remaining space in the middle. I've already created a weak, nonatomic IBOutlet
for the scroll view on my view controller's header file. What I don't understand is how, when I print out its frame values from the owner view controller, the width and height values are zero.
This is the view controller's header file:
#import <UIKit/UIKit.h>
@interface AdGalleryViewController : UIViewController<UIScrollViewDelegate>
@property (nonatomic, weak) IBOutlet UIScrollView *scrollView;
@property (nonatomic, strong) NSArray *imageURLs;
@end
The implementation file:
- (void)viewDidLoad
{
[super viewDidLoad];
CGRect svFrame = self.scrollView.frame;
NSLog(@"scroll view frame: %@", NSStringFromCGRect(svFrame));
}
Output:
2013-07-05 15:36:21.447 Sulit[2733:907] scroll view frame: {{0, 0}, {0, 0}}
What is going on?