title: UIButtonBackground image smaller then button frame. How do I make equal?
body: <p>I am skinning <code>UIButtons</code> and I've found that my button's width is much wider then what is displayed by the images. </p>
  
  <p>I call the button method below with a specified frame and size: </p>
  
  <p><code>CGSize buttonSize = CGSizeMake(240, 64);</code></p>
  
  <pre><code>+ (UIButton *)buttonWithThemeAndFrame:(CGRect )frame title:(NSString *)title target:(id)target selector:(SEL)selector {
  
      UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
      [button setFrame:frame];
      button.backgroundColor = [UIColor yellowColor];
      NSString *defaultName = @"button_main_up";
      NSString *highlighted = @"button_main_down";
      [button setBackgroundImage:[[UIImage imageNamed:defaultName] stretchableImageWithLeftCapWidth:12 topCapHeight:12.0] forState:UIControlStateNormal];
      [button setBackgroundImage:[[UIImage imageNamed:highlighted] stretchableImageWithLeftCapWidth:12 topCapHeight:12.0] forState:UIControlStateHighlighted];
  
      [button.titleLabel setFont:[UIFont boldSystemFontOfSize:12.0]];
      [button setTitle:title forState:UIControlStateNormal];
      [button setTitleColor:[UIColor colorWithWhite:1.0 alpha:0.5] forState:UIControlStateDisabled];
      button.titleLabel.shadowOffset = CGSizeMake(0.0, -1.0);
      button.titleLabel.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
      [button addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside];
      button.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin;
  
      return button;
  }
  </code></pre>
  
  <p>Note the yellow background is added to illustrate what size the button's frame actually is. Why isn't my image that size also?
  <img src="https://i.stack.imgur.com/eWJTR.png" alt="enter image description here"></p>
  
  <p>Here is my button image:<img src="https://i.stack.imgur.com/lE0xv.png" alt="enter image description here"></p>