1.不要用titlelabel来设置textcolor,要用setTitleColor方法
官方原话:
Do not use the label object to set the text color or the shadow color. Instead, use the setTitleColor:forState: and setTitleShadowColor:forState: methods of this class to make those changes.
The titleLabel property returns a value even if the button has not been displayed yet. The value of the property is nil for system buttons.
本文介绍如何正确地为UIButton设置文字颜色,并指出使用titleLabel属性的误区;同时讲解了如何确保应用程序支持iPhone 5及更高版本设备的屏幕尺寸。
2767

被折叠的 条评论
为什么被折叠?



