美文网首页
隐藏pickerView自带两条分割线

隐藏pickerView自带两条分割线

作者: Still4ever幺惊云 | 来源:发表于2017-03-24 17:41 被阅读0次

    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自带两条分割线

          本文链接:https://www.haomeiwen.com/subject/djvfottx.html