Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Issue with Custom Text Field Backgrounds (and iOS7 update needed) #33

Open
Slider257 opened this issue Jan 14, 2014 · 0 comments
Open

Comments

@Slider257
Copy link

I'm writing a form app that uses a lot of Text fields just like the example app. However, my designer wishes to have a custom Text Field Border style and color;

textField.layer.cornerRadius=8.0f;
textField.layer.masksToBounds=YES;
[[textField layer] setBorderColor:[[UIColor colorWithRed:171.0/255.0 green:171.0/255.0 blue:171.0/255.0 alpha:1.0] CGColor]];
textField.layer.borderWidth= 1.0f;

This is so when the user is currently editing a Text Field the field can turn a Blue color often seen on a lot of websites lately. The idea is that only the field being edited turns Blue. Using the left and right arrows on the BSKeyboardControls works fine, and the fields change correctly. However, when the user does NOT use the left / right arrows and instead manually jumps fields (by manually tapping the field), the field stays the same blue color instead of reverting back to the Gray Color. The following code (found in the TextFieldShouldBeginEditing command line) is what causes this:

[self.keyboardControls setActiveField:textField];

Removing this sequence lets the manual field jump change colors correctly, but naturally it removes the previous / next functionality of the Control Bar.

Any chance you can issue a fix for this so that even if the user manually jumps to different fields they will change color appropriately?

Just as an FYI, XCode gives me 2 warnings on this line contained in the .m file:

[self.segmentedControl setSegmentedControlStyle:UISegmentedControlStyleBar];

setSegmentedControlStyle and UISegmentedControlStyleBar are both depreciated as of iOS7. Just wanted to give you a heads up in an otherwise very handy and excellently built project!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant