title: Display more than one image in screen
body: <p>I have imageView under scrollview. When i select particular image from scrollview it displays center of the screen. When i select another image, the previous image will goes off. I can't display more than one image in screen.</p>
  
  <p>code:</p>
  
  <pre><code>- (void)viewDidAppear:(BOOL)animated {
    myImageView = [[UIImageView alloc]initWithFrame:CGRectMake(100, 10, 200, 200)];
      [self.view addSubview:myImageView];
  }
  
  - (void)loadNextPage:(int)index {  
      int countFlag = 0;
      for(int i=index*4;i&lt;(index+1)*4;i++)
      {
          UIButton *imageView=[[UIButton alloc]initWithFrame:CGRectMake((320*index)+countFlag*80+ 2, 5, 75, 75)];
          imageView.tag=i+1;
          [imageView addTarget:self action:@selector(imageViewClicked:) forControlEvents:UIControlEventTouchUpInside];
          //[imageView.layer setBorderColor:[UIColor lightGrayColor].CGColor];
          // [imageView.layer setBorderWidth:1.0f];
          switch ((i+1)%15) {
              case 0:
                  [imageView setImage:[UIImage imageNamed:@"img.png"] forState:UIControlStateNormal];
                  break;                    
              case 1:
                  [imageView setImage:[UIImage imageNamed:@"img1.png"]  forState:UIControlStateNormal];
                  break;
              case 2:
                  [imageView setImage:[UIImage imageNamed:@"img2.png"]  forState:UIControlStateNormal];
                  break;
              case 3:
                  [imageView setImage:[UIImage imageNamed:@"img3.png"]  forState:UIControlStateNormal];
                  break;
              case 4:
                  [imageView setImage:[UIImage imageNamed:@"img4.png"]  forState:UIControlStateNormal];
                  break;
              case 5:
                  [imageView setImage:[UIImage imageNamed:@"img5.png"]  forState:UIControlStateNormal];
                  break;
          break;
          }
  
          [myScrollView addSubview:imageView];
  
          countFlag++;
     }
   }
  
  - (void)imageViewClicked:(id)sender{
      switch ([sender tag]%15) {
          case 0:
              [myImageView setImage:[UIImage imageNamed:@"img.png"]];
              // myImageView.tag=1;
              [myImageView setTag:0];
              break;
          case 1:
              [myImageView setImage:[UIImage imageNamed:@"img1.png"]];
              //  myImageView.tag=2;
              [myImageView setTag:1];
              break;
          case 2:
              [myImageView setImage:[UIImage imageNamed:@"img2.png"]];
              [myImageView setTag:2];
              break;
          case 3:
              [myImageView setImage:[UIImage imageNamed:@"img3.png"]];
              [myImageView setTag:3];
              break;
          case 4:
              [myImageView setImage:[UIImage imageNamed:@"img4.png"]];
              [myImageView setTag:4];
              break;
          case 5:
              [myImageView setImage:[UIImage imageNamed:@"img5.png"]];
              [myImageView setTag:5];
              break;
      }
  
      [self.view addSubview:myImageView];
  }
  </code></pre>