Making programmatic UIButton highlight onclick

Discussion in 'iOS Programming' started by vegashacker, Jul 2, 2008.

  1. vegashacker macrumors newbie

    Apr 20, 2008
    Check out, for example, the UICatalog sample app. Under "Buttons", click the first button (labeled "Gray") and no visual feedback is given to the user that it was clicked. You have to hold down in order to make it appear that it was clicked. In fact, the button *is* being clicked in the first case, it's just not visually showing that (I know this because you can look in the console logs which running the simulator).

    Is this a bug? Expected behavior? In either case, how do I make it look like the button is being clicked when it is clicked. Note that if you make a button with IB, there is no problem. So it's something with programmatically generating buttons.

  2. vegashacker thread starter macrumors newbie

    Apr 20, 2008
    This may be about buttons inside of table views. When I place the button on top of the table view (instead of in a table cell), the clicking behavior is normal.
  3. tacoman667 macrumors regular

    Mar 27, 2008
    Have you looked into the documentation for the iPhone UITableView on overriding the selectRowFromIndexPath or whatever it's called? You may need to do that and inside the method set the "state" of the button to the highlighted state? (I haven't gone that far just yet myself.)

    I am so far behind, too much side work and not enough time to work on my personal app. I still don't feel guilty for paying 99 bucks for the program though! :)

Share This Page