title: Why the origin of contentview doesn't coincide the origin of scrollview when application setup?
body: <p><a href="http://i.stack.imgur.com/NAhy6.gif" rel="nofollow">The problem shows in the gif picture.</a> (The view in yellow is the contentview. The view in black is the scrollview.)</p>
  
  <p><a href="https://github.com/UtopiaCHN/ProblemSolving.git" rel="nofollow">The whole project code on Github.</a></p>
  
  <p>Here is the code :</p>
  
  <pre><code>CGRect frame = CGRectMake( 50, 100, 200, 200);
  UIScrollView *scrollView= [[UIScrollView alloc] initWithFrame:frame];
  [self.view addSubview:scrollView];
  
  frame= CGRectMake( 0, 0, 500, 500);
  UIImageView *myImageView= [[UIImageView alloc] initWithFrame:frame];
  [scrollView addSubview:myImageView];
  scrollView.contentSize = CGSizeMake(500,500);
  
  scrollView.backgroundColor = [UIColor blackColor];
  myImageView.backgroundColor = [UIColor yellowColor];
  
  scrollView.contentOffset = CGPointMake(0, 0)
  </code></pre>
  
  <p>One more problem shows in the picture:
  Why the horizontal scrollbar is not at bottom of scrollview?</p>
  
  <p>When I added a view between the scrollview and self.view the problem disappeared. </p>
  
  <p>The code that I added:</p>
  
  <pre><code>UIView *view = [UIView new];
  [self.view addSubview:view];
  </code></pre>
  
  <p>I found that the problem happened when I used UITabBarController.</p>