2016-03-05 86 views
-1
func changeColor(sender: UIButton) { 
    self.view.backgroundColor = UIColor.randomColor() 
} 

生成錯誤: - Type 'UIColor' has no member 'randomColor'爲什麼在我的UIcolour中出現這個錯誤?

+0

@ user5473955-對於UIColor(),他們沒有方法randomcolor那就是爲什麼你得到這個錯誤。 –

回答

0

這是因爲在UIColor上沒有方法randomColor方法。

有關可用方法,請參閱UIColor Documentation

相關問題