How to set the border of UITextView to same as border color of UITextField

前端 未结 8 2058
遇见更好的自我
遇见更好的自我 2020-12-24 10:37

By default UITextField has a light gray color as its border color. I want to set my UITextView to have the same border color as the UITextField.

I tried:

<         


        
8条回答
  •  抹茶落季
    2020-12-24 11:13

    Try this code for Swift

    let borderColor = UIColor.whiteColor.Cgcolor()
    
    myTextView.layer.borderColor = borderColor.CGColor;
    myTextView.layer.borderWidth = 1.0;
    myTextView.layer.cornerRadius = 5.0;
    

提交回复
热议问题