开发者

Keep NSButton highlighted

开发者 https://www.devze.com 2023-02-15 22:24 出处:网络
Quite simple question here. How can I keep a NSButton highlighted? It seems that whenever the user presses my highlighted button开发者_如何学运维, the button becomes unhighlighted. Any suggestions?

Quite simple question here. How can I keep a NSButton highlighted? It seems that whenever the user presses my highlighted button开发者_如何学运维, the button becomes unhighlighted. Any suggestions?

Thanks in advance!


I think you are looking for:

[[btnFilter1 cell] setHighlighted:YES];


If you're setting it up in a XIB/NIB, you can set the type of the button to toggle/push on push off/etc.


I'm guessing you want an almost one way toggle button? You could change the UIControlStateNormal to what the UIControlStateHighlighted.

-(void)buttonPressed
{
    [button setImage:[UIImage imageNamed:@"highlighted_image.png"] forState:UIControlStateNormal];
}
0

精彩评论

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