[:en]Swift: create bottom line of TextFields[:]

[:en]

 // Create a bottom line of textfields
    override func viewDidLayoutSubviews() {
        let border = CALayer()
        let width = CGFloat(2.0)
        border.borderColor = UIColor.darkGrayColor().CGColor
        border.frame = CGRect(x: 0, y: booknameTextField.frame.size.height - width, width:  booknameTextField.frame.size.width, height: booknameTextField.frame.size.height)
        
        border.borderWidth = width
        booknameTextField.layer.addSublayer(border)
        booknameTextField.layer.masksToBounds = true
    }

[:]

Print Friendly, PDF & Email
Scroll to Top