简体   繁体   English

为OSX构建可可UI

[英]Build a Cocoa UI for OSX

I'm trying to build a UI which look like this: 我正在尝试构建一个如下所示的UI:

在此处输入图片说明

I'm using a storyboard with Xcode but I don't know how to start. 我在Xcode中使用情节提要,但我不知道如何开始。 I think a need different view in the window to manage button, text and tree but I don't know I to do it. 我认为需要在窗口中使用其他视图来管理按钮,文本和树,但我不知道该怎么做。 I have try to use a split view but it gave me only 2 views instead of 3. 我尝试使用拆分视图,但它只给了我2个视图,而不是3个。

Any help in Cocoa and storyboard is welcome. 欢迎在可可和情节提要中提供任何帮助。

Thanks 谢谢

Can't see where you'd want to use an NSSplitView but the UI you're attemting to create is trivial - 无法看到要在哪里使用NSSplitView但是要创建的UI却很琐碎-

  • A plain NSWindow with the toolbar items configured as per your screenshot. 一个普通的NSWindow ,根据您的屏幕截图配置了工具栏项。
  • An NSOutlineView for the tree view with the three columns, 具有三列的树形视图的NSOutlineView
  • the content border of the window sized accordingly to make room for the label you intend to put at the bottom of the window. 窗口的内容边框的大小将相应调整,以便为您打算在窗口底部放置的标签腾出空间。

As mentioned in the comments one way to populate the outline view would be to use an NSTreeController and Cocoa bindings . 如评论中所述,填充大纲视图的一种方法是使用NSTreeControllerCocoa绑定 That's probably the only slightly more complicated bit about this UI.. 这可能是关于此UI的唯一稍微复杂的一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM