FS.O5 FS.O5 - 6 months ago 12
iOS Question

Make UIButton both image and text tappable

I have a

with text and an image that looks like this:


But when I click the button it goes like this (just the image is selected instead of both the image and the text, I want button text also be selected.

Selected Button

How can I fix it?


Yes, you can set this color in your xib (interface builder) also, just select your button and inside State config select Highlighted and then set the textColor for that state. Check image for reference.

enter image description here