ios 7.1 UITextField tint color doesn't change in storyboard

落花浮王杯 提交于 2019-12-23 21:11:22

问题


Up till iOS 7.0, the text field tint color changed to the color you set in storyboard. As of iOS 7.1, it won't change unless you do it programmatically.

Is this a bug? Does anyone know?


回答1:


Here is the solution to work with storyboard.

1) Go to "Identity Inspector"

2) Add "tintColor" attribute in "User Defined Runtime Attributes"

3) Set the desired color.

Thats it.

Or if you want to use same tint color for all textfields throughout the app, juse use,

[[UITextField appearance] setTintColor:color];




回答2:


I have also faced this problem but tint color is working from code.

self.txtPassword.tintColor=[UIColor whiteColor];


来源:https://stackoverflow.com/questions/23268090/ios-7-1-uitextfield-tint-color-doesnt-change-in-storyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!