Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Antialiasing with PNG on button

I've got an issue with antialiasing on iOS. I have created a button and set its background to be a PNG image. On the iPad, it looks like this:

ipad screenshot

Whereas on the storyboard it looks like this:

xcode storyboard

And here are my settings in the attributes panel of xcode:

xcode settings for button

like image 401
Emile Victor Avatar asked Nov 12 '22 17:11

Emile Victor


1 Answers

You should provide the 2x images in your resource too, so as to display them properly on retina device. Please make sure you have both version of images as mentioned & set just the normal-image name. The 2x image is searched in the resource & will be taken automatically while execution.

wizard-ceiling-desel-ipad.png

[email protected]

Its not just the name matters, you should also keep the size of images in 2x ratio. For example if normal image is 32x32 then make sure the 2x image is of size 64x64

Hope this helps.

like image 116
Balram Tiwari Avatar answered Nov 15 '22 06:11

Balram Tiwari