开发者

How to programmatically get the highlighted state of a UIButton

i am setting the state of a UIButton to highlighted state programmatically.

[currentButton setHighlighted:YES];

once the user presses the button, i need to check if it is already in the highlighted state and accordingly perform some action.开发者_StackOverflow But, the state of the button is getting changed automatically after it is being pressed. I think this is the default behavior of a UIButton. Is there any way in which i can first check wether the button is already in the highlighted state???


Hilighted state is only for that time when user press a button as user remove his finger it will return to its notmal state, you can set a selected state for a button and can check for this.


Maybe:

if(currentButton.highlighted){

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜