UISearchBar remove background on iOS 4.1

后端 未结 1 684
一向
一向 2021-01-23 05:21

I\'m trying to remove the background of UISearchBar to make it transparent. I tried these solutions:

1.

for (UIView *subview in searchBar.subviews) {
if          


        
相关标签:
1条回答
  • 2021-01-23 05:31

    This should work:

    [[searchBar.subviews objectAtIndex:0] removeFromSuperview];
    [searchBar setBackgroundColor:[UIColor clearColor]];
    
    0 讨论(0)
提交回复
热议问题