title: How to set specific size to UIImageView
body: <p>I got a weird bug going on. I'm trying to programatically initialize an UIImageView with a specific frame and image. My image is 60x60, but I'm trying to resize it to 30x30 on the screen, which seems impossible. </p>
  
  <p>The following works, but show the image in 60x60:</p>
  
  <pre><code> UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo.png"]];
      [imgView setContentMode:UIViewContentModeScaleAspectFit];
  //    imgView.frame = CGRectMake(100, 200, 30, 30);
      imgView.center = CGPointMake(pointTouch.x, pointTouch.y);
      [self.view addSubview:imgView];
  </code></pre>
  
  <p>And the following just doesn't show anything at all on the screen:</p>
  
  <pre><code>  UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo.png"]];
      [imgView setContentMode:UIViewContentModeScaleAspectFit];
      imgView.frame = CGRectMake(100, 200, 30, 30);
      imgView.center = CGPointMake(pointTouch.x, pointTouch.y);
      [self.view addSubview:imgView];
  </code></pre>
  
  <p>What's wrong?</p>
  
  <p><strong>EDIT</strong>: <strong>for those having the same problem, here is the working code:</strong></p>
  
  <pre><code>UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo.png"]];
  imgView.frame = CGRectMake(self.view.bounds.size.width/2, self.view.bounds.size.height/2, 30, 30);
  imgView.center = CGPointMake(pointTouch.x, pointTouch.y);
  [imgView setContentMode:UIViewContentModeScaleAspectFill];
  [self.view addSubview:imgView];
  </code></pre>