Joao Batista
Joao Batista

Reputation: 145

UIButton selected content only when touched

Is it possible to see the selected state content of an UIButton only when I'm touching it?

Upvotes: 0

Views: 60

Answers (1)

matt
matt

Reputation: 534893

When you're touching a button, the button is highlighted. Call setTitle:forState: to give the button the normal title (UIControlStateNormal), and call setTitle:forState: to give it the highlighted title (UIControlStateHighlighted). Now you'll see one title normally and the other title when you touch the button. The same thing for the other button features, like setImage:forState:.

Upvotes: 1

Related Questions