如何激活没有标题栏的窗口
我可以发送消息 makeKeyAndOrderFront: 来激活窗口。但是,如果我将其发送到没有标题栏的窗口,则不会使其处于活动状态。有没有办法让没有标题栏的窗口处于活动状态?
I can send the message makeKeyAndOrderFront: to make a window active. However, if I send this to a window without a title bar, it doesnt make it active. Is there any way to make a window without a title bar active?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要覆盖
-canBecomeKeyWindow
在您的NSWindow
子类中返回YES
。根据文档:
You need to override
-canBecomeKeyWindow
in yourNSWindow
subclass to returnYES
.As per the docs: