Commits

Christopher Denter committed 3fa526b

Make the scrollview the root view of the VC.

Comments (0)

Files changed (1)

iOS7Tests/BAScrollingTestViewController.m

 
 @implementation BAScrollingTestViewController {
     UIColor *_color;
+    UIScrollView *_scrollView;
 }
 
 - (id)initWithColor:(UIColor *)color
     return self;
 }
 
-- (void)viewDidLoad
+- (void)loadView
 {
-    [super viewDidLoad];
-
-    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];
-    UIView *coloredThingieSoWeCanSeeScrolling = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), 15)];
+    UIView *coloredThingieSoWeCanSeeScrolling = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 15)];
     coloredThingieSoWeCanSeeScrolling.backgroundColor = _color;
-    [scrollView addSubview:coloredThingieSoWeCanSeeScrolling];
-    scrollView.contentSize = self.view.bounds.size;
-    [self.view addSubview:scrollView];
+
+    _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 568)];
+    [_scrollView addSubview:coloredThingieSoWeCanSeeScrolling];
+    _scrollView.contentSize = _scrollView.bounds.size;
+
+    self.view = _scrollView;
 }
 
 @end