我正在尝试制作一款与Apple的Mac OS App Store非常相似的应用程序,其中窗口的标题不可见,但它有一个带有图标和标签的工具栏。
问题是,当我将窗口的标题可见性设置为隐藏在我的Window Controller中时,它还会隐藏toolbarItem标签。
window?.titleVisibility = .hidden
我尝试明确设置工具栏以显示图标和标签,但似乎忽略了这一点。
toolbar.displayMode = .iconAndLabel
答案 0 :(得分:1)
你可以代替
self.window?.titleVisibility = .hidden
以下
self.window.title = "" // no title but the labels for toolbar icons are there
答案 1 :(得分:0)
你需要从一个原始的&无边界的nswindow开始,你必须自己绘制它。在github上有一个很好的INAppStoreWindow(或者4年前很好;)),它可以模仿appstor的外观和感觉