I want to change tint color of Textfield to blue color and cancel button tint color of UISearchBar to white color.
I am using below code.
for (UIView *subView in searchBar.subviews)
{
for (UIView *ndLeveSubView in subView.subviews)
{
if([ndLeveSubView isKindOfClass:[UITextField class]])
{
[(UITextField *)subView setTintColor:[UIColor blueColor]];
}
else if ([ndLeveSubView isKindOfClass:[UIButton class]])
{
[(UIButton *)subView setTintColor:[UIColor whiteColor]];
}
}
}
But this changes both Textfield and cancel button's tint color to white. Can any one suggest another method for it?
Here's what I am getting...
The tint color of TextField is also White.....