如何在Objective-C中创建首选项窗口? [英] How do I create a preferences window in Objective-C?

查看:278
本文介绍了如何在Objective-C中创建首选项窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个偏好设定视窗,像标准的Mac OS X应用程式(Safari等)。我找到了资源,如 DBPrefsWindowController 从2008年的苹果HIG匹配。



只是想知道是否有一种新的方法来实现这一点?我不能在Interface Builder中找到任何标准窗口,所以我认为苹果不提供这些,也不能找到一个官方的苹果示例代码提供这个标准UI。



谢谢

解决方案

看起来DBPrefsWindowController不再可用。



目前,我会推荐最新的 RHPreferences 框架。



可在 GitHub 上使用。 BSD许可。



它是一个简单易用的首选项窗口控制器,有多个选项卡用于您的下一个Mac应用程序。



它还提供:




  • 在不同大小的标签视图之间自动调整大小(使用动画)

  • 自定义NSToolbarItem

  • 支持占位符NSToolbarItems(例如NSToolbarFlexibleSpaceItemIdentifier& NSToolbarShowFontsItemIdentifier)

  • ul>

    I would like to create a preferences window like in the standard Mac OS X apps (Safari etc.). I have found resources like DBPrefsWindowController from back in 2008 that matches the Apple HIG.

    Just wondering if there is a new way to accomplish this? I can't locate any standard windows in Interface Builder so I assume Apple doesn't provide those, nor can I locate a official Apple sample code for providing this standard UI.

    Thank you

    解决方案

    It seems DBPrefsWindowController is no longer available.

    For now, i would recommend the up to date RHPreferences framework.

    Available on GitHub. BSD Licensed.

    Its a simple and easy Preferences window controller with multiple tabs for your next Mac application.

    It also provides:

    • Auto resizing between different sized tab views (With animation)
    • Custom NSToolbarItem support
    • Persistence of the last used tab
    • Support for placeholder NSToolbarItems (eg NSToolbarFlexibleSpaceItemIdentifier & NSToolbarShowFontsItemIdentifier)

    这篇关于如何在Objective-C中创建首选项窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆