title: How to change the image on UIScrollView
body: <p>I have a scroll view with multiple images. The images are scrollable.  </p>
  
  <p>I am using the following code:</p>
  
  <pre><code>scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
  
  scrollView.pagingEnabled = YES;
  
  scrollView.delegate = self;
  
  scrollView.showsVerticalScrollIndicator = NO;
  
  scrollView.showsHorizontalScrollIndicator = NO;
  
  
  NSInteger numberOfViews = [arrayImage count];
  
  for (int i = 0; i &lt; numberOfViews; i++)
  {
      CGFloat yOrigin = i * scrollView.frame.size.width;
      imageView = [[UIImageView alloc]initWithFrame:CGRectMake(yOrigin  +30, 0, self.view.frame.size.width-60 , self.view.frame.size.height)];
      imageView.image = [UIImage imageNamed:[arrayImage objectAtIndex:i]];
      [scrollView addSubview:imageView];
      [imageView release];
  }
  scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * numberOfViews,0);
  [self.view addSubview:scrollView];
  [scrollView release]
  </code></pre>
  
  <p>The application will work with iPad orientations, but the images are not properly scrolled in the landscape mode. </p>
  
  <p>It works fine with portrait mode, but the images merge in landscape mode.</p>
  
  <p>If somebody has any idea, please share....</p>