A.S.
A.S.

Reputation: 320

How to handle image on disable UIButton

I have an image 128 x 128 px. Setting on a custom button size 42 x 42.

Issue: I am placing that image on button. When that button in enabled state, image looks good : enter image description here

But when button is in disabled state, image quality is distorted, like this enter image description here

I am not sure how to deal with this problem. Any pointers on this is very much appreciated.

One more info. this is for retina display.

Thanks

Upvotes: 0

Views: 477

Answers (2)

Fernando Cervantes
Fernando Cervantes

Reputation: 2962

One approach is to use a Boolean and set it to true or false whenever the button is pressed. And then change the image in accordance to the Boolean state.

Upvotes: 0

yuji
yuji

Reputation: 16725

I would try resizing the image to the right size: i.e., 84x84 for the retina version and 42x42 for the regular version.

Upvotes: 1

Related Questions