OS X 中 NSTableView 添加/删除按钮的位置 [英] Location of Add/Delete Buttons for an NSTableView in OS X

查看:45
本文介绍了OS X 中 NSTableView 添加/删除按钮的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我一定遗漏了一些简单但对 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

  • 设置StyleSmall Square
  • Mode设置为Momentary
  • 将Segment 0的Image设置为NSAddTemplate
  • 将Segment 1的Image设置为NSRemoveTemplate
  • 将Segment 0和1的width设置为Auto
  • 将 Segment 2 的 width 设置为固定宽度.
  • Set Style to Small Square
  • Set Mode to Momentary
  • Set the Image of Segment 0 to NSAddTemplate
  • Set the Image of Segment 1 to NSRemoveTemplate
  • Set the width of Segment 0 and 1 to Auto
  • Set the width of Segment 2 to a fixed width.

这篇关于OS X 中 NSTableView 添加/删除按钮的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆