I'm trying to remove border of UISearchBar in iOS 7. In iOS 6 it's working fine. I created the UISearchBar programatically. I tried almost every thing from Stack Overflow and Google.
SearchBar looking right now
What i want to achieve
I tried all these stuffs mentioned below
searchBar.layer.borderWidth = 1;
searchBar.layer.borderColor = [[UIColor whiteColor] CGColor];
and
for (id img in searchBar.subviews)
{
if ([img isKindOfClass:NSClassFromString(@"UISearchBarBackground")])
{
[img removeFromSuperview];
}
}
and
for (UIView *sub in self.tableView.tableHeaderView.subviews) {
if ([sub isKindOfClass:[UIImageView class]]) {
sub.hidden = YES;
}
}
but still no success.