UIButton background image stretched Xcode iOS -


i have uibutton created storyboard. size of button different on different iphone devices. set background image image same width , height (images assets) different resolution. test app iphone 6 , iphone 4. size of button different on both screens. normal, background image stretched on iphone 4 (with iphone 6 not because size of button on iphone 6 square (same width , height)).

my question if possible show image without stretching no matter button size. searched on net , found slicing image. don´t understand how can solve problem?

background image , image uibutton, both having different functionality. if set background image uibutton, stretch image fit if set image uibutton, won't stretch image can try set image button instead of background image

to set image uibutton

uiimage *btnimage = [uiimage imagenamed:@"image.png"]; [btn setimage:btnimage forstate:uicontrolstatenormal]; 

to set background image uibutton

[btn setbackgroundimage:btnimage forstate:uicontrolstatenormal]; 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -