修改UISearchBar背景色
//iOS7.1 [[[[_searchBar.subviews objectAtIndex:0] subviews] objectAtIndex:0] removeFromSuperview]; [_searchBar setBackgroundColor:[UIColor colorWithRed:245.f/255.f green:238.f/255.f blue:219.f/255.f alpha:1]]; //iOS7.0 [_searchBar setBarTintColor:[UIColor clearColor]]; [_searchBar setBackgroundColor:[UIColor colorWithRed:245.f/255.f green:238.f/255.f blue:219.f/255.f alpha:1]]; //iOS7.0以下 [[_searchBar.subviews objectAtIndex:0] removeFromSuperview]; [_searchBar setBackgroundColor:[UIColor colorWithRed:245.f/255.f green:238.f/255.f blue:219.f/255.f alpha:1]];