0
我只在圖像上實現自定義選取器視圖。問題是,圖像重疊在對方喜歡的是: UIPickerView無法正確顯示圖像
這是代碼在選擇器視圖配置圖片:
func pickerView(pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusingView view: UIView!) -> UIView {
let chosenImage: UIImageView = UIImageView(image: UIImage(named: iconArray[row]))
NSLog("choosen image \(iconArray[row])")
let workaroundImageView: UIImageView = UIImageView(frame: chosenImage.frame)
workaroundImageView.backgroundColor = UIColor(patternImage: chosenImage.image!)
return workaroundImageView
}
我缺少什麼?有什麼建議麼?
謝謝!完全忘了這種方法!隊友的歡呼聲! –
沒問題!很高興能有幫助! –