ios - iOS 中的自定义按钮和状态

标签 ios image uibutton state

这是给已经向 Apple Store 提交应用程序的人的问题:是否需要为自定义 UIButton 设置图像或背景,为每个按钮设置一个状态?有时我只为正常状态设置一个按钮图像,然后系统在点击按钮时默认突出显示,但我已经看到在 Xcode 的控制台中有时会出现一些消息说某些按钮的状态未设置......

谢谢!

编辑。控制台中的消息与此类似:

button text attributes only respected for UIControlStateNormal, UIControlStateHighlighted and UIControlStateDisabled. state = 4 is interpreted as UIControlStateHighlighted.

最佳答案

否 - 在您的 UIButton 上调用 setImage:forState 只是可选的。仅在您认为合适时执行此操作。

关于ios - iOS 中的自定义按钮和状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19781975/

相关文章:

iphone - 将动态输入的数据保存到 plist

Java GUI 应用程序 - 在 map 上叠加图像(背景图像)

iphone - 从磁盘加载图像时的 ScrollView 和表格 View 性能

swift - UIButtonType 未在 Swift Playground 中显示

ios - 使用填充有字母的 UiButtons 来造词

ios - 从iPad Magazine App入手,如何制作阅读器

ios - 从 SceneKit 导出 USDZ 会导致模型变暗

php - CSS 图像减速

ios - 在同一个类中调用UIButton AddTarget

iphone - UIAlertView 错误 : bool _WebTryThreadLock(bool),