title: Tiling a UIImageView using resizeableImageWithCapInsets:resizingMode?
body: <p>I'm using the following code to try to create a tiled image with cap insets, and seeing the image below as the results in the simulator. My source image is 145x83 pixels in size, and shown here too. What am I doing wrong?</p>
  
  <p><strong>SOURCE IMAGE:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/fYTyw.png" alt="enter image description here"></p>
  
  <p><strong>RESULTS IN SIMULATOR:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/OET2U.png" alt="enter image description here"></p>
  
  <p><strong>CODE:</strong></p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      UIImage *cloudImage = [UIImage imageNamed: @"cloud.png"];
      [cloudImage resizableImageWithCapInsets: UIEdgeInsetsMake(10, 10, 10, 10) resizingMode: UIImageResizingModeTile];
  
      UIImageView *imageView1 = [[UIImageView alloc] initWithImage: cloudImage];
      [imageView1 setFrame: CGRectMake(50, 50, 100, 100)];
  
      UIImageView *imageView2 = [[UIImageView alloc] initWithImage: cloudImage];
      [imageView2 setFrame: CGRectMake(250, 50, 200, 200)];
  
      [self.view addSubview: imageView1];
      [self.view addSubview: imageView2];
  
  }
  </code></pre>