nstitlebaraccessoryviewcontroller

How to use NSTitlebarAccessoryViewController?

倖福魔咒の 提交于 2019-12-06 08:27:45
问题 Can anyone tell me how to use NSTitlebarAccessoryViewController, to add subview to a view with an example? As I am new to mac programming you may have to explain from basics. Please. 回答1: NSTitlebarAccessoryViewController is for adding subviews to the windows title bar. Here is a example: Set up a view in interface builder. Go to the `applicationDidFinishLaunching: method to add the view to the title bar. The code would be the following: NSTitlebarAccessoryViewController* vc = [

How to use NSTitlebarAccessoryViewController?

一笑奈何 提交于 2019-12-04 12:41:29
Can anyone tell me how to use NSTitlebarAccessoryViewController, to add subview to a view with an example? As I am new to mac programming you may have to explain from basics. Please. NSTitlebarAccessoryViewController is for adding subviews to the windows title bar. Here is a example: Set up a view in interface builder. Go to the `applicationDidFinishLaunching: method to add the view to the title bar. The code would be the following: NSTitlebarAccessoryViewController* vc = [[NSTitlebarAccessoryViewController alloc] init]; vc.view = self.view; vc.layoutAttribute = NSLayoutAttributeRight; [self