OS X 中 NSTableView 添加/删除按钮的位置 [英] Location of Add/Delete Buttons for an NSTableView in OS X
问题描述
我想我一定遗漏了一些简单但对 Xcode 不熟悉的东西......具体来说,我正在用 Swift 编码,但我相信这更像是一个 .xib 文件问题.在 NSTableView 之外添加和删除按钮很容易(比如本地邮件应用程序的 Preferences->Signatures 面板),但是如何将这些集成到 NSTableView 本身中?(更像是本机邮件应用程序的首选项-> 帐户面板)理想情况下,我希望该选项不仅仅是添加/删除按钮,但一旦我了解添加更多功能的过程应该很容易.
I think I must be missing something simple but being new to Xcode... Specifically I am coding in Swift but I believe this is more of a .xib file question. It is easy to have add and delete buttons outside of an NSTableView (like the native Mail app's Preferences->Signatures panel) but how do you integrate these into what seems to be the NSTableView itself? (more like the native Mail app's Preferences->Accounts panel) Ideally I want the option to have more than just add / delete buttons present but once I understand the process adding more functionality should be easy.
推荐答案
这些按钮没有集成,它只是一个 NSSegmentedControl
对齐到表格视图的底部.
These buttons are not integrated, it's just an NSSegmentedControl
aligned to the bottom of the table view.
要获得 NSSegmentedControl
- 设置
Style
为Small Square
- 将
Mode
设置为Momentary
- 将Segment 0的
Image
设置为NSAddTemplate
- 将Segment 1的
Image
设置为NSRemoveTemplate
- 将Segment 0和1的
width
设置为Auto
- 将 Segment 2 的
width
设置为固定宽度.
- Set
Style
toSmall Square
- Set
Mode
toMomentary
- Set the
Image
of Segment 0 toNSAddTemplate
- Set the
Image
of Segment 1 toNSRemoveTemplate
- Set the
width
of Segment 0 and 1 toAuto
- Set the
width
of Segment 2 to a fixed width.
这篇关于OS X 中 NSTableView 添加/删除按钮的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!