Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Jordan Winkelman
9,434 PointsiOS, How to style all textFields to be the same color
I have used this code to style all segmented controls [[UISegmentedControl appearance] setTintColor:[PCResourcesTab gACream]]; but when I try to style all my text fields with this code [[UITextField appearance] setTextColor:[UIColor redColor]]; it doesn't work. I am only able to style individual textFields using this code self.majorLabelText.textColor = [UIColor whiteColor];
1 Answer
Kieran Robinson
9,411 PointsNot 100% sure this is it, but have you conformed to the UITextFieldDelegate protocol? <UITextFieldDelegate>?
Kieran
Kieran Robinson
9,411 PointsKieran Robinson
9,411 Pointsadding < UITextFieldDelegate > should do this
Jordan Winkelman
9,434 PointsJordan Winkelman
9,434 PointsThanks a lot, it worked!