I want to change textfield color not background color but near part of textfield border just like shadow. As shown in image.
Asked
Active
Viewed 133 times
1
-
Check this http://stackoverflow.com/a/5749376/3976183 answer – Kumar Jun 29 '15 at 05:22
-
Do you have any designer ? ;) Just ask him to provide Image and use it in background of TextField, Or try CALayer to create same thing. ` textField.layer.cornerRadius=8.0f; textField.layer.masksToBounds=YES; textField.layer.borderColor=[[UIColor redColor]CGColor]; textField.layer.borderWidth= 1.0f;` – Mrug Jun 29 '15 at 05:22
-
thanks @Mrug i will handle it with designer.. – Bhavin Ramani Jun 29 '15 at 07:11
2 Answers
2
If you want to add shadow in UITextField
as you display in image then the easiest way will be that design image of that UITextField
and set it to it UITextField
background.

Dhaval Parmar
- 46
- 4
1
IT's so simple just slice that image and put that image in Textfield background. or Use the Code suggest by @Mrug.
textField.layer.cornerRadius=5.0f;
textField.layer.masksToBounds=YES;
textField.layer.borderColor=[[UIColor blackColor]CGColor];
textField.layer.borderWidth= 1.5f;

Mrug
- 4,963
- 2
- 31
- 53

Chetan kasundra
- 508
- 2
- 14