remove the border of uitextfield in uisearchbar
I wanna custom the UISearchBar control to a style as showed in the picture below: First I should remove the background view, then find out the UITextfiled in UISearchBar, extend the frame of UITextfiled and remove the boarder of it. Here is my code : UITextField *searchField; NSUInteger numViews = [self.subviews count]; for(int i = 0; i != numViews; i++) { if([[self.subviews objectAtIndex:i] isKindOfClass:[UITextField class]]) { //conform? searchField = [self.subviews objectAtIndex:i]; } } if(!(searchField == nil)) { [searchField setBorderStyle:UITextBorderStyleNone]; searchField.frame = self