Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,561
6,059
I would like to make it so that a button highlights when it's selected, and remains highlighted until another is selected.

Any suggestions?

I have tried simply adding to the method that the button invokes to have it remain highlighted, but that doesn't work because UIButton automatically unhighlights itself on touch up after the method it invokes is called.
 

Darkroom

Guest
Dec 15, 2006
2,445
0
Montréal, Canada
not sure if it's possible to control the highlight graphics like you want simply with IB. you'll have to roll your own highlight animations that make good use boolean variables, etc. the attached file should help you.
 

Attachments

  • UIButtonBarPressedIndicator.png
    UIButtonBarPressedIndicator.png
    6.7 KB · Views: 596

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,561
6,059
I found a way to make it work.

The method that the button invokes involves creating a UIPicker. While the picker is finding the titles, it disables and highlights the button. (It disables the button so that touching it won't cause touchup to fire again, thus automatically ending the highlight.)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.