NSTableView与加号和减号按钮 [英] NSTableView with Plus and Minus buttons
问题描述
我如何做这样的事?
在Interface Builder库中没有找到任何适当的对象。
任何想法?
我发现的最好的方法是使用NSSegmentedControl。
样式:小方形
模式:选择瞬间
看起来更好。现在,使用image字段设置 NSAddTemplate 和 NSRemoveTemplate 。
好,我们有 + , - 空段。要防止用户选择最新的一个,请从细分:弹出窗口中选择,然后关闭启用复选框(位于状态: strong> label)。
最后,我们要做的是设置前两段的 width >
- 转到尺寸检查器
- 选择段0
- 关闭修复复选框(片段应立即自动调整大小以适合图片)
- 1 并重复3号。
- 现在,当您调整控件大小时,只有上一个细分会改变宽度。
- Go to Size inspector
- Select Segment 0
- Turn off "Fixed" checkbox (segment should immediately autoresize to fit image)
- Select Segment 1 and repeat number 3
- Now as you resize control, only last segment will change width
- Put it at the bottom of your table view and resize as well.
享受;)
How can I do something like that?
I didn't find any appropriate object in the Interface Builder library.
Any thoughts?
The best way that i found is to use NSSegmentedControl.
after you dragged it on the canvas, you should configure its style:
Style: Small Square
Mode: Select Momentary
looks better. Now use "image" field to set NSAddTemplate and NSRemoveTemplate. Make sure that label field is empty.
Ok, we have "+", "-" and one empty segment. To prevent the latest one to be selected by the user, select it from Segment: pop up and turn off Enabled check box (located next to State: label).
And lastly, what we have to do is set width of first two segments to make them square.
Enjoy ;)
这篇关于NSTableView与加号和减号按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!