创建 NSToolbar 样式按钮
是否有一种斜角样式可以复制 NSToolbar 样式的按钮,例如在 Safari 的首选项窗口中用于在不同窗格之间切换?
我需要使用 NSButtons 在 NSView 中复制 NSToolbar。我知道我可能应该使用 NSTabView,但我想实现 xcode 左窗格的外观。这里的任何提示将不胜感激。
Is there a bevel style that can replicate NSToolbar style of buttons that are used, for instance, in the Safari's preferences window to switch between different panes?
I need to replicate NSToolbar in an NSView using NSButtons. I understand that I should probably be using NSTabView, but I'd like to implement the look of xcode's left pane. Any tips here would be appreciated greatly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有任何内置内容,您必须自己创建图像。然而,复制该行为很简单。
您可以简单地使用
NSButton
对象的单行NSMatrix
。只需为按钮提供一个图像和一个备用图像(用于突出显示状态)并将矩阵模式设置为 NSRadioModeMatrix 即可。There's nothing built-in, you'd have to create the images yourself. However, replicating the behaviour is straightforward.
You could simply use a single-row
NSMatrix
ofNSButton
objects. Just give the buttons an image and an alternate image (for the highlighted state) and set the matrix mode toNSRadioModeMatrix
.