uisearchbar 去除背景

[searchBar setBackgroundColor:[UIColor clearColor]];

for (UIView *subview in searchBar.subviews)

{

if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")])

[subview removeFromSuperview];

}

//self.navigationItem.titleView =searchBar;

你可能感兴趣的:(search)