作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我可以发送消息 makeKeyAndOrderFront: 来激活窗口。但是,如果我将其发送到没有标题栏的窗口,它不会激活。有什么方法可以使没有标题栏的窗口处于事件状态?
最佳答案
您需要覆盖 -canBecomeKeyWindow
在您的 NSWindow
子类中返回 YES
。
根据文档:
Attempts to make the window the key window are abandoned if this method returns NO. The NSWindow implementation returns YES if the window has a title bar or a resize bar, or NO otherwise.
关于objective-c - 如何激活没有标题栏的窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8279951/
我是一名优秀的程序员,十分优秀!