0

I am using a searchbar with the uitextField subview programatically. I get the image as below:

enter image description here

Here there is a dark color in the upper line. How can i avoid to get a plain thin line ?

i use this code:

searchbar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, (self.view.frame.size.height*10)/100, self.view.frame.size.width, (self.view.frame.size.height*13)/100)];
searchbar.delegate=self;

for (searchBarSubview in [searchbar subviews]) {
    if ([searchBarSubview conformsToProtocol:@protocol(UITextInputTraits)] ) {
        @try {

            [[searchbar.subviews objectAtIndex:0] removeFromSuperview];
            searchbar.backgroundColor=[UIColor clearColor];

        }
        @catch (NSException * e) {
            // ignore exception
        }
    }
}
Preethi
  • 195
  • 1
  • 10

0 Answers0