您的位置:首页 > 博客中心 > 网络系统 >

Mac - 让文本框成为第一响应者

时间:2022-04-03 11:23

[[textfield window] makeFirstResponder:textfield];

 

设置window 的位置。
windowWillLoad:中设置

在 windowDidBecomeMain: 方法中设定 window 现实的位置。

[self.window setFrameOrigin:NSMakePoint(0,0)];
- (IBAction)takeSelectedIndexFrom:(nullable id)sender; 
  设置调用这个方法可以翻页。 NSPagecontrolller

   item.labelConstraint.constant = 20 * self.ibdLayout.widthRatio;
设定 固定的window  如果主window 关闭,使用通知,关闭整个APP
显示如下:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(browserWindowWillClose:) name:NSWindowWillCloseNotification object:browserWindow];

 

热门排行

今日推荐

热门手游