问题标签 [nstabview]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
xcode - macOS 中用于非基于文档的应用程序的选项卡功能
在 macOS Sierra 下的 Xcode 8 中,可以创建基于文档的应用程序,并且它能够自动在选项卡中显示不同的打开文档,就像 Safari 或 Xcode 本身在 macOS Sierra 之前所做的那样。现在,我想知道我是否也可以在不同的环境中使用它。想象一个应用程序,用户可以从下拉菜单中加载一本书。我喜欢那本书的章节可以通过选项卡视图进行选择。然而,标准的 NSTabView 看起来不像我之前提到的那样好,所以这不是一种选择。
autolayout - NSTabView 中 NSSplitView 的布局问题 - 缺少约束
我做了一个非常简单的虚拟项目来说明我的问题(在 10.12.1 上使用 Xcode 8.1)。我有一个带有 2 个选项卡的 NSTabViewController 的故事板,其中一个是 NSSplitViewController。尽管一切似乎都运行良好,但我在运行时看到以下警告:
“TabSplitViewDummy[3615:89221] [Layout] 检测到 <_NSSplitViewItemViewWrapper: 0x6000001a0d20> 缺少约束。由于没有足够的约束来完全定义大小和原点,因此无法放置。添加缺少的约束,或设置 translatesAutoresizingMaskIntoConstraints=YES 和约束将为您生成。如果此视图在 macOS 10.12 及更高版本上手动布局,您可以选择不从覆盖中调用 [super layout]。在 DETECTED_MISSING_CONSTRAINTS 上设置断点以进行调试。此错误只会记录一次。
我尝试为所有视图设置 translatesAutoresizingMaskIntoConstraints=YES 以及设置约束 - 没有任何效果。到目前为止,我只发现了 3 件事:
- 当我更改选项卡的顺序以使拆分视图在启动时不可见时,没有警告消息
- 当我删除选项卡视图并制作窗口的拆分视图内容时,没有警告消息
- 当我在 DETECTED_MISSING_CONSTRAINTS 上设置一个符号断点时,它会被击中 6 次,所以我猜有 6 个缺少约束
我已经为此失去了好几天,我在这里错过了什么?
非常感谢你的帮助!!!
html - 我可以在本机脚本中将 iOS 选项卡视图放在顶部吗?
我正在创建一个本机脚本应用程序,我希望我的选项卡视图出现在 iOS 的顶部。我知道将 tabView 粘贴在顶部违反了人机界面指南,但我需要这样做。
swift - Swift:复制一个 NSTabViewItem(或一个 NSView)保留绑定?
因此,我有一个 NSTabView,其中包含许多彼此几乎相同的 NSTabViewItem。从逻辑上讲,我认为制作模板并根据需要多次复制可能会更好。但事实证明它并不像我希望的那样简单。
我发现将 NSTabViewItem 的副本从 NSTabView 添加到同一个 NSTabView中,这或多或少地回答了这个问题,除了该方法不会在我的新视图中保留绑定(或者可能是连接)。
有没有办法做到这一点,以保存一切?
swift - Swift/Cocoa: How to bind a value to currently selected tab
Working on a Preference Pane. I've got an NSTabView; tabs are created dynamically from a XIB. They're all very similar, but not identical. So, I need some values to change (and some controls to appear or disappear) according to which tab is currently selected.
Normally one would think it would be possible to bind to NSTabView.selectedTabViewItem; but this does not work. Why? The value is never updated.
Then I got more creative and thought of making a computed property that returns the appropriate value for the binding to observe. Still no dice. The bindings get evaluated when the app is started and never get updated.
Then I decided to go messy and made a delegate to implement the tabView's didSelect method, whereby the currently selected tab is written to a stored property that the binding can observe.
This last approach works, but it feels very clunky and dirty. Does anyone know a better way?
Edit: I'm attempting to implement the NSTabViewController but I just can't get it to work!
If I manually bind the NSTabViewController to the NSTabView object I made in IB, everything appears to be initialized properly, but the tabs never show up. And, if I try to initialize everything in the controller, and then assign the NSTabView via the NSTabViewController.tabView property, I get
Which is odd, because I am trying to do it the way the do
cumentation specifies. In fact, even if I try to do TabViewController.tabView = NSTabView()
I get the same error. Is this a bug?
Here's the entire relevant portion of my code,
swift - Swift 中每个 NSTabViewItem 一个视图控制器
我正在快速为 mac OSX 编写一个应用程序,我想清楚地分离代码,所以我正在寻找一种方法来为 NSTabView 中的每个 NSTabViewItem 提供一个视图控制器,而不使用选项卡视图控制器。是否可以 ?
objective-c - 将辅助 NSWindow 最小化到页脚选项卡托盘,如 Apple Mail (Mac)
我正在尝试在全屏时实现辅助窗口最小化功能,例如 Apple Mail。
在全屏模式下,单击撰写时,撰写窗口会出现在前台。
然后单击最小化将撰写窗口移动到页脚选项卡托盘,而不是将其最小化到 Dock,在那里它会看不见。