-1
func changeColor(sender: UIButton) {
self.view.backgroundColor = UIColor.randomColor()
}
生成錯誤: -
Type 'UIColor' has no member 'randomColor'
。爲什麼在我的UIcolour中出現這個錯誤?
func changeColor(sender: UIButton) {
self.view.backgroundColor = UIColor.randomColor()
}
生成錯誤: -
Type 'UIColor' has no member 'randomColor'
。爲什麼在我的UIcolour中出現這個錯誤?
這是因爲在UIColor
上沒有方法randomColor
方法。
有關可用方法,請參閱UIColor
Documentation。
@ user5473955-對於UIColor(),他們沒有方法randomcolor那就是爲什麼你得到這個錯誤。 –