Bordered UITextView

后端 未结 14 2185
一个人的身影
一个人的身影 2020-12-04 10:11

I want to have a thin gray border around a UITextView. I have gone through the Apple documentation but couldn\'t find any property there. Please help.

14条回答
  •  北海茫月
    2020-12-04 10:28

    The thing that made it work (in addition to following the answers here) is adding the borderStyle attribute:

    #import 
    ..
    
    phoneTextField.layer.borderWidth = 1.0f;
    phoneTextField.layer.borderColor = [[UIColor blueColor] CGColor];
    phoneTextField.borderStyle = UITextBorderStyleNone;
    

提交回复
热议问题