Is there a way how to customise UIButton
in interface builder for different states of that button?
Asked
Active
Viewed 1,102 times
1

Bartłomiej Semańczyk
- 59,234
- 49
- 233
- 358
-
yes, of course:-) it is possible. At the bottom, while you creating the question, there is a checkbox: "answer your own question". This is under "share your knowledge" program:) you can use it if you want. I vote your answer up. – Bartłomiej Semańczyk Sep 06 '15 at 08:41
-
Well, the thing is that there is a huge amount of answers for this question already. I don't know if it would be necessary to open a new question for this. – MasterRazer Sep 06 '15 at 08:43
-
@MasterRazer: self-answering is [actively encouraged behaviour](http://stackoverflow.com/help/self-answer). Provided the question and answer are otherwise fitting the site rules, of course. If you think this is a duplicate, you are welcome to flag it as such. – Martijn Pieters Sep 06 '15 at 08:51
-
@MasterRazer: and by flagging, I meant you find a suitable canonical post and flag this post as a duplicate of that post. :-) – Martijn Pieters Sep 06 '15 at 09:00
-
@MartijnPieters I consider leaving this question not marked as a duplicate, because surely there are plenty answers to set each UIButton property via IB. However, there isn't a question which asks to set all UIButton propertys via IB. – MasterRazer Sep 06 '15 at 09:07
-
@MasterRazer: then don't, that's up to you. – Martijn Pieters Sep 06 '15 at 09:09
1 Answers
3
Yes, it is possible, let's say this is the default state:
Now let's change the title for highlighted
state:
This is how it looks before I press the button:
...and after:
You can do the same for every property of the button.
Note: default
and highlighted
states are controlled automatically, but selected
and disabled
you have to control manually.

halfer
- 19,824
- 17
- 99
- 186

Bartłomiej Semańczyk
- 59,234
- 49
- 233
- 358