Using resizableImageWithCapInsets: image for button only works for the state set, other states show a “gap”

后端 未结 2 1408
傲寒
傲寒 2020-12-12 22:53

When using resizableImageWithCapInsets: to create an image for a UIButton only the normal state (the state set the image with using setBackgroundImage:forState:) works. All

2条回答
  •  既然无缘
    2020-12-12 23:13

    I was experiencing problems while using resizable images on iOS5 too. It turns out that if your button is of type "RountedRect" and you manipulate the background images, the resizable images will not behave as expected. (iOS6 handles this ok, presumably by assuming your new button type and adjusting as needed.)

提交回复
热议问题