我编写了这样的代码,但它无法正常工作。
func refreshPageData() {
if(isAudioSelected)
{
self.songsButton.backgroundColor = UIColor(patternImage: UIImage(named:"rectangle54")!)
self.songsButton.titleLabel?.textColor = UIColor.white
self.videosButton.backgroundColor = UIColor.white
}
}
答案 0 :(得分:0)
试试这个
func refreshPageData() {
if(isAudioSelected)
{
self.songsButton.setBackgroundImage(UIImage(named:"rectangle54")!, for: .normal)
self.songsButton.titleLabel?.textColor = UIColor.white
self.videosButton.backgroundColor = UIColor.white
}
}