ilight ilight - 1 year ago 250
iOS Question

Change UITextField borderColor in Xamarin

I need to change a UITextField's borderColor to White in Xamarin.

I tried setting it's

and also runtime attributes in XCode IB but it was of no use.

Could someone please help me in achieving this?

Answer Source

This should get you there:

var textField = new UITextField();

textField.Layer.BorderColor = UIColor.White.CGColor;
textField.Layer.BorderWidth = 1f;

If that does not work, please show more code. Because then I presume your overwriting the style somewhere.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download