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.
因为 UISwitch 不是那么容易定制的,所以我决定我想单独构建一个。除了一件事之外,它的效果非常好。我在构建 UIView 时对其进行了子类化,现在我没有界面构建器所需的“ValueChanged”控件。有人可以告诉我如何将 ControlEvents 添加到我的自定义控件中吗?
非常非常感谢你 !
问题解决了我应该继承自 UIControl 而不是 UIView