UITextField border color

后端 未结 9 1474
一生所求
一生所求 2020-11-28 02:43

I have really great wish to set my own color to UITextField border. But so far I could find out how to change the border line style only.

I\'ve used background prope

9条回答
  •  温柔的废话
    2020-11-28 03:25

    Import the following class:

    #import  
    

    //Code for setting the grey color for the border of the text field

    [[textField layer] setBorderColor:[[UIColor colorWithRed:171.0/255.0
                                                       green:171.0/255.0
                                                        blue:171.0/255.0
                                                       alpha:1.0] CGColor]];
    

    Replace 171.0 with the respective color number as required.

提交回复
热议问题