Set NSWindow Size programmatically

前端 未结 6 2057
栀梦
栀梦 2021-02-01 19:19

How can I set the window size programmatically? I have a window in IB and I want to set the size of it in my code to make it larger.

6条回答
  •  闹比i
    闹比i (楼主)
    2021-02-01 20:20

    Use setFrame:display:animate:

    [window setFrame:NSMakeRect(0.f, 0.f, 200.f, 200.f) display:YES animate:YES];
    

提交回复
热议问题