Question

I'm creating an app and I'm styling some controls like text fields and buttons with layers (for example changing the border color and thickness), or simply by changing the background color of the control from the Interface Builder.

On iOS 7 it's all working good, but when I run the application on iOS 6 (simulator) I see old style controls plus borders of the layer.

The two versions were running both with the iOS 6.1 SDK.

Here is the screen of what is happening: (I can't post images for the reputation on SO)

enter image description here

EDIT:

The code for the textfields i use is this:

   UITextField* textField = (UITextField*) aView;
   textField.layer.cornerRadius = 0.0;
   textField.layer.borderColor = [[UIColor lightGrayColor] CGColor];
   textField.layer.backgroundColor = [[UIColor whiteColor] CGColor];

And for the "Login" button i simply changed the background color in the IB.

Was it helpful?

Solution

In order to remove the border of the textFields, set the borderStyle to none:

textField.borderStyle = UITextBorderStyleNone;

As for the Login button, don't forget to set the button's type to Custom in IB.

enter image description here

Tell me if that works.

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