隐藏pickerView自带两条分割线

func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {

let lbl = UILabel.init(frame: CGRectMake(x: 0, y: 0, width: SCREENW, heigth: 50))

lbl.text = self.datas[row]

lbl.font = UIFont.systemFont(ofSize: 18.0)

lbl.textColor = UIColor.black

lbl.textAlignment = .center

//隐藏pickerView自带两条分割线的方法:

pickerView.subviews[1].isHidden = true

pickerView.subviews[2].isHidden = true

return lbl

}

你可能感兴趣的:(隐藏pickerView自带两条分割线)