UITextField Only Top And Bottom Border

后端 未结 11 961
温柔的废话
温柔的废话 2020-12-07 22:46

I currently have a regular border. I would like to only have a top and bottom border.

How do I accomplish this?

Using the UITextField<

11条回答
  •  無奈伤痛
    2020-12-07 23:52

    Updated for Swift 5

    var bottomBorder = CALayer()
    bottomBorder.frame = CGRect(x: xVal, y: yVal, width: w, height: h)
    bottomBorder.backgroundColor = UIColor.black.cgColor
    searchBar.layer.addSublayer(bottomBorder)
    

提交回复
热议问题