Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
鼠标下方的NSView按钮仍然可以点击该按钮。如何解决这个问题呢 ?让NSView覆盖按钮,让按钮不能被点击。
默认情况下 NSView 不处理 mouseDown/mouseUp 事件,将其发送到下一个对象。您应该处理 NSView 对象上的 mouseDown/mouseUp 消息,以免将事件更深地传递给响应者链。