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 的选定状态内容?
当您触摸一个按钮时,该按钮会突出显示。调用setTitle:forState:给按钮正常标题(UIControlStateNormal),调用setTitle:forState:给它突出显示的标题(UIControlStateHighlighted)。现在,当您触摸按钮时,您将正常看到一个标题和另一个标题。其他按钮功能也是如此,例如setImage:forState:.
setTitle:forState:
setImage:forState: