FS.O5 FS.O5 - 1 year ago 100
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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download