我只是使用
在每行中设置了一个UIPickerView,其中包含不同的图像func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
let rowImg = UIImage(named: array[row] + ".png")
let rowView = UIView(frame: CGRect(x:0,y:0,width:60,height:60))
rowView.backgroundColor = UIColor(patternImage: rowImg!)
return rowView
}
我注意到图像比我喜欢的更柔和,颜色从鲜红色变成几乎柔和的红橙色。不管怎么说?