views:

59

answers:

4

hi...

At the time of click a button it's highlighted. While click the button i want to avoid the highlighting of button.

In my Application background image for the button is square shape if i'm click the button it shows square outline of the button.but my button is customtype only....

Please help me out to solve this....

Thank you Renya

+1  A: 

Try setting button's adjustsImageWhenHighlighted property to NO

Vladimir
[homebut setAdjustsImageWhenHighlighted:NO]; I've added this code into my application.First time click this button it's higligted.Next click it's not highlighted...why the first time it's highlighting?please help me to do this....Thank you...
Waiting for your reply...
Can any one tell me the solution to solve this...
I've just made a sample app with your code - it does not highlight an image... where do you set adjustsImageWhenHighlighted property in your code?
Vladimir
I have given this code [homebut setAdjustsImageWhenHighlighted:NO]; in ViewDidLoad method because B'coz i'm writting code for creating the button and adding the button to the view in ViewDidLoad method only...Please help me to solve this issue...Thank you
I've used exactly your code in my sample and put in viewDidLoad method as well...
Vladimir
ok...Thank you...
A: 

Hello

Did you try adding :

[ homebut setHighlighted:NO ];

?

Vinzius
+2  A: 

If you are creating button using Interface Builder..

Inside the button Attribute Inspector ..

On the top .. there is drop down box.. which has different states of the button like Default, Highlighted, Selected etc.. you can set Button's behavior here..

KiranThorat
I'm creating the button programmatically .I tried this code [homebut setAdjustsImageWhenHighlighted:NO];at the first time of click the button is highlighted and the next click it's not highlighting...What should i do to solve this issue...please help me out to do this...Thank you
A: 

set adjustsImageWhenHighlighted property to YES...
it will avoid the highlight of UIButton