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.
我对 UIButton 类进行了子类化,现在将使用石英 2d 绘制自定义视图。一切看起来都很好,但是如何在单击按钮时使按钮变暗。如果我在同一个类中使用石英来绘制按钮,如何设置不同状态的视图?
谢谢你的帮助
当一个按钮被点击时,setHighlighted: 方法被调用。如果你覆盖它,你可以在点击(和释放)时做任何你想做的事情。重绘或切换视图。