Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change UITextField borderColor in Xamarin

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

I tried setting it's layer.borderColor and also runtime attributes in XCode IB but it was of no use.

Could someone please help me in achieving this?

like image 211
ilight Avatar asked Jan 23 '14 09:01

ilight


1 Answers

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.

like image 82
Krumelur Avatar answered Oct 30 '22 01:10

Krumelur