Is there a standard, documented, development pattern to create UI layouts similar to iTunes, iCal, iPhoto, etc?

不打扰是莪最后的温柔 提交于 2019-12-01 10:47:38

问题


I am new to Cocoa development and I am trying to create UI layouts using what I consider to be the "standard" layout that is shared by apps like iTunes, iCal, iPhoto, Billings, 1Password, Numbers, Delicious Library, etcetera. This typical layout can be described as follows:

  • A "Library" panel on the left side of the screen, usually meant for discovering hierarchies. This panel usually covers about a fourth of the horizontal space.
  • A "Main" panel to the right of the Library panel on which most of the UI interactions take place. This takes the remaining horizontal space and is where we find things like the monthly calendar view in iCal, or the tile of album art and playlists in iTunes.
  • Some "Utility" panel on the bottom-left corner of the screen, usually for things like additional options.

Is there a documented pattern that will show best practices on how to "wire" the View and Controller classes for these types of layouts? For instances, how many ViewControllers to use, whether or not using an NSDocument-based approach makes sense, some common pitfalls, etcetera? This layout is so prevalent, that I am surprised that there doesn't seem to be any good reference on it.

Update: I forgot to mention that I have access to the Apple Developer site, and while I can find the library reference for the different classes in Cocoa, I cannot seem to find a good reference for how to bring it all together in the layout I describe.

Books like Aaron Hillegass' and others out there are great to learn the basics on Cocoa and creating simple interfaces (a few controls laid out on an view connected to an NSDocument), but not so great at guiding you to the UI layout I describe.

Thanks.


回答1:


The hierarchical view on the left is called a Source View and you would normally create this with the NSOutlineView class.

Have a look at Apple's SourceView sample code. It implements a source view very similar to the one in the Finder and elsewhere and should give you a big head start.




回答2:


The range of applications you mentioned is so wide that it is impossible to give a direct answer.

In general, the item you call a Library is usually an NSOutlineView (for hierarchies) or an NSTableView.

The main panel really depends on the actions contained within, same for the utility panel.

My suggestion is to read Apple's Human Interface Guidelines for OS X. This will give you the best overview of how to do things. Other than that, the actual implementations are too dependent on the individual program.



来源:https://stackoverflow.com/questions/6934036/is-there-a-standard-documented-development-pattern-to-create-ui-layouts-simila

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!