How to style UITextview to like Rounded Rect text field?

后端 未结 20 2337
深忆病人
深忆病人 2020-11-28 00:36

I am using a text view as a comment composer.

In the properties inspector I can\'t find anything like a border style property so that I can make use a rounded rect,

20条回答
  •  爱一瞬间的悲伤
    2020-11-28 01:36

    In iOS7 the following matches UITextField border perfectly (to my eye at least):

    textField.layer.borderColor = [[[UIColor grayColor] colorWithAlphaComponent:0.5] CGColor];
    textField.layer.borderWidth = 0.5;
    textField.layer.cornerRadius = 5;
    textField.clipsToBounds = YES;
    

    There is no need to import anything special.

    Thanks to @uvieere and @hanumanDev whose answers go me almost there :)

提交回复
热议问题