Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITextField inner shadow

I want to get rid of the inner shadow of an UITextField.

UITextField with inner shadow

I have tried setting the shadow-alpha to 0 but it doesn't work:

name.layer.shadowOpacity = 0.0f;

Any clues would be appreciated.

like image 510
Dimme Avatar asked Dec 10 '11 06:12

Dimme


1 Answers

Solution found.

name.borderStyle = UITextBorderStyleNone;
name.layer.borderWidth = 1.0f;
name.layer.borderColor = [[UIColor grayColor] CGColor];
name.layer.cornerRadius = 5.0f;

I just needed to play with the border options of the layer while deactivating the old border-style.

like image 129
Dimme Avatar answered Sep 22 '22 02:09

Dimme