Changing text color with Swift

ぃ、小莉子 提交于 2020-01-05 05:01:43

问题


I'd like to change the text color of a cell in my table view. If i do this it's not working. In xcode6 beta 1 it works but on the final version of xcode6 it's not working.

Code:

cellGrow.textColor = UIColor.whiteColor()

Error: 'textColor' is unavailable: APIs deprecated as of iOS 7 and earlier are unavailable in Swift


回答1:


Is cellGrow a UITableViewCell? In that case use this:-

cellGrow.textLabel?.textColor = UIColor.whiteColor()


来源:https://stackoverflow.com/questions/26423838/changing-text-color-with-swift

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