简体   繁体   English

INAppStoreWindow工具栏

[英]INAppStoreWindow Toolbar

I was wondering how I could add a toolbar in the titlebar using INAppStoreWindow . 我想知道如何使用INAppStoreWindow在标题栏中添加工具栏。 I succesfully added InAppStoreWindow in my application but I was thinking how to add a toolbar like the 'AppStore.app' in the center of my titlebar using INAppStoreWindow. 我成功在应用程序中添加了InAppStoreWindow,但是我正在考虑如何使用INAppStoreWindow在标题栏的中心添加类似“ AppStore.app”的工具栏。

Nowhere on the internet nor stackoverflow has a similer topic about this toolbar inside this INAppStoreWindow method. 在Internet上,stackoverflow在INAppStoreWindow方法中都没有关于此工具栏的类似主题。 I hope somebody could tell me if this is possible and how as I can't find any examples. 我希望有人能告诉我这是否可行,以及如何找不到示例。

If you create an NSView with the contents of what you want to be on your window's titlebar, and have IBOutlets to both your window and that view, it can be done in 2 lines of code. 如果您使用窗口标题栏上要显示的内容创建一个NSView,并且对窗口和该视图都具有IBOutlet,则可以用两行代码完成。

(In this case, the view is titleView and the window is theWindow ) (在这种情况下,视图是titleView和窗口是theWindow

//Make the titlebar view the same size
[self.titleView setFrameSize:self.theWindow.titleBarView.frame.size];

//Add the view to the window's "titleBarView"
[self.theWindow.titleBarView addSubview:self.titleView];

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

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