I have UIButton that was created with storyboard. The size of the button is different on different iPhone devices. Then I set as background image an image with same width and height (images assets) for different resolution. I test my app with iPhone 6 and iPhone 4. The size of my button is different on both screens. That is normal, but the background image is stretched on iPhone 4 (with iPhone 6 not because probably the size of the button on iPhone 6 is square (same width and height)).
My question is if it is possible to show the image without stretching no matter the button size. I searched on the net and found about slicing image. But I don´t understand how can I solve this problem?
Background Image and Image for
UIButton, both are having different functionality. If you set background Image for aUIButton, it will stretch your image to fit but If you set image forUIButton, then it won't stretch your image So you can try to set image for button instead of background imageTo set image for
UIButtonTo set background image for
UIButton