PDA

View Full Version : Making an "unclickable" button




Moon013
Jul 15, 2008, 10:55 PM
Hi,
I am currently working on a button (a UIButton type provided in Interface builder), which will turns to be "unclickable" after clicked for the first time. I expect the button to change color, informing the user that the button cannot be clicked anymore.

Is there a way to do it? I have gone through the UIButton header file and can't seem to find a way to make that happen...

In addition, I wanted to change the text too. The UIButton provides a variable called *_titleView. But it seems it is not the one that changes the text.



grimjim
Jul 18, 2008, 03:10 PM
Can you not simply do:
[button setEnabled:NO];

I haven't tried it on the device yet, but it works in the simulator.

Moon013
Jul 20, 2008, 08:33 PM
I had written that line of code and is being put into a function which is triggered only when the button is clicked. So by right, when clicked, function triggered, the button should be made unclickable, but still it doesn't work...

Moon013
Jul 24, 2008, 03:53 AM
Oops, I didn't link my button...Now it works!

So sorry about it and as well thanks.:)