1

i want like this http://savepic.ru/3302429.png

but i get - http://savepic.ru/3296285.png

how you can see all input text - black ofc i can fix it -

for (UIView * v in _searchBar.subviews) {
        if ([v isKindOfClass:NSClassFromString(@"UITextField")]) {
            UITextField * t = (UITextField *)v;
            t.textColor = [UIColor whiteColor];
        }
    } 

and text be white BUT search icon and icon - "x" still black (

anybody have any ideas how i can fix it ?

1 Answers1

0

Try the following code.

UITextField *searchField = [searchbar valueForKey:@"_searchField"];
searchField.textColor = [UIColor whiteColor];

OR

for(UIView *sub View in searchBar.subviews){
            if([subView isKindOfClass:UITextField.class]){
                [(UITextField*)subView setTextColor:[UIColor whiteColor]];
            }
        }

Hope it will work for you.

Siba Prasad Hota
  • 4,779
  • 1
  • 20
  • 40