iphone中按鈕的觸摸效果

[英]touch effect for Button in iphone


how can i just change the color,of a button when i set the focus on the button in iphone. I mean to say , for example we have 5 buttons, and i am just setting the focus on each of the button. i want those buttons to be higlighted with different color. but when press or touch up inside the utton, the navigation is made to the respective forms, that is set for that button.

當我把焦點放在iphone的按鈕上時,我怎么能改變按鈕的顏色呢?我的意思是,例如,我們有5個按鈕,我只是把焦點放在每個按鈕上。我想要那些鈕扣用不同的顏色裝飾。但當在utton內部按下或觸摸時,導航就被設置為相應的表單,這是為那個按鈕設置的。

2 个解决方案

#1


0  

you can write method, for example, let it be

你可以寫方法,例如,順其自然

- (void) changeButtonState:(UIButton*) buttonToChange;

then you can call it in your onBtnClk method for button you need. in that method you can change image for your button's UIControlStateNormal mode. and if I understand right, you can use toolbar or tabbar instead of buttons.

然后可以在onBtnClk方法中為需要的按鈕調用它。在該方法中,您可以為按鈕的UIControlStateNormal模式更改圖像。如果我理解正確的話,你可以用工具欄或者表格欄代替按鈕。

#2


0  

Guess you have already asked this issue differently here..

我想你在這里已經提出了不同的問題。

But have you checked the answer?? You can use any of those methods at your will!

你查過答案了嗎?你可以任意使用這些方法!

关注微信公众号

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2009/11/24/72000c3f4418fad630dc48bba105ef88.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com