开发者

Keep NSButton highlighted

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜