Question

I want to change only bottom border style. Is it possible? I know this code

theTextFiels.layer.borderColor=[[UIColor blueColor]CGColor]; // border rengi
theTextFiels.layer.borderWidth= 5.0f; // border kalınlığı

but this apply the changes to all borders (up, right, left, bottom) How can I change the only bottom border color?

Was it helpful?

Solution

you won't be able to change only one side border color unless you subclass and know you way around in draw rect method of UIView.

You should try @stiles way ..making a image and then setting it as background...

Steps are : Make four images ; each with a different side as a color border you want. Then change the text field background to the appropriate one.

You should make the images as similar as to original text field ..this way you can achieve what your want,

OTHER TIPS

You can do it using an image.

myTextField.background = [UIImage imageNamed:@"blue-line.png"];

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top