自动调整 NSTabView 的大小以适合内容视图
我有一个带有许多 NSView 项目的 NSTabView 。我想调整选项卡视图的大小,以便显示的视图始终紧贴选项卡视图。
我已经在 tabView 的委托 didSelectTabViewItem 和 shouldSelectTabViewItem 中尝试了 setFrame 的多种变体,但似乎无法让它工作。我想我必须更改 tabView 的 contentRect 的大小,但这似乎是只读的。
任何人都可以给我一个快速指示,也许以前已经完成过这件事(我在谷歌上没有运气)。
谢谢,
约翰
I have a NSTabView with a number of NSView items. I want to resize the tab view so that the displayed view always fits snugly within the tab view.
I've tried a number of variations of setFrame within the tabView's delegate didSelectTabViewItem and shouldSelectTabViewItem but can't seem to get it to work. I think I have to change the size of the tabView's contentRect, but this seems to be readonly.
Can anyone please give me a quick pointer to perhaps where this has been done before (I'm having no luck with Google).
Thanks,
John
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我终于明白了:
在 Xcode(.xib 编辑器)中,选中“调整大小”框

容器窗口的
单击“tabView”并检查此
此处 
最后只需在尺寸检查器中调整其调整大小规则即可!
Ok I finally got it:
In Xcode (.xib editor), check the Resize box

of the container window
Click on the "tabView" and check this
here 
At last simply adapt its resizing rules in the Size Inspector, that is!