NSTableView with Plus and Minus buttons

后端 未结 4 1881
情书的邮戳
情书的邮戳 2020-12-01 05:37

How can I do something like that?

\"Screenshot\"

I didn\'t find any appropriate object in the Interface

4条回答
  •  一向
    一向 (楼主)
    2020-12-01 06:19

    One answer here suggests using gradient buttons, however these buttons cannot be disabled as this causes the background to change and thus breaks the look. Another one suggested using a segmented control, which is almost perfect but segmented controls don't support autoresizing, e.g. if the table width is dynamic. My suggestion is a combination of both. Use a segmented control for the actual buttons and a gradient button to fill the rest of the table width that now can also be dynamic if the button width is dynamic as well.

    See my answer to a similar question (with screenshots): https://stackoverflow.com/a/22586314/15809

提交回复
热议问题