gpt4 book ai didi

cocoa - 非方形 NSButton

转载 作者:行者123 更新时间:2023-12-03 16:20:34 26 4
gpt4 key购买 nike

如何创建一个具有非方形“点击区域”的 NSButton?

示例:

enter image description here

谢谢。

最佳答案

您可能可以子类化 NSButton 并重写 hitTest: 以在位于您希望可点击的区域之外时返回 nil。 (进入后返回[super hitTest:]。)

Docs here.

关于cocoa - 非方形 NSButton,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10313938/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com