0

So when I customize my button I put a background image like this:

- (void) styleUIButtons {
    UIImage *buttonNormalBg = [[UIImage imageNamed:@"button_normal" ] stretchableImageWithLeftCapWidth:0 topCapHeight:0];
    UIImage *buttonSelectedBgb = [[UIImage imageNamed:@"button_selected" ] stretchableImageWithLeftCapWidth:0 topCapHeight:0];

    id appereance = [UIButton appearance];

    [appereance setTintColor:self.mainNavigationBarTextColor];
    [appereance setBackgroundImage:buttonNormalBg forState:UIControlStateNormal];
    [appereance setBackgroundImage:buttonSelectedBgb forState:UIControlStateHighlighted];
}

But the disclosure indicator of the table change horribly to a single line. Why does this happened? and how can I avoid it? Am I customizing the button wrongly?enter image description here

Necronet
  • 6,704
  • 9
  • 49
  • 89

2 Answers2

0

stretchableImageWithLeftCapWidth:topCapHeight: is deprecated.

Use resizableImageWithCapInsets: instead.

Mundi
  • 79,884
  • 17
  • 117
  • 140
0

I copied your code and the images are working fine for me. The only thing I had to add was a frame.

The tintColor only seems to work when there aren't background images.

Ann Taylor
  • 111
  • 2
  • 4