2016-02-01 14 views
5

Mam UISearchBar dodany do początku UITableView.UISearchBar minimal style ma przezroczyste tło

 // init search bar 
    self.resultSearchController = ({ 
     let controller = UISearchController(searchResultsController: nil) 
     controller.searchResultsUpdater = self 
     controller.dimsBackgroundDuringPresentation = false 
     controller.searchBar.sizeToFit() 
     controller.searchBar.tintColor = Config.grayColor() 
     controller.searchBar.searchBarStyle = UISearchBarStyle.Minimal 

     self.tableView.tableHeaderView = controller.searchBar 

     // set content offset for table view in order 
     // that the searchbar is hidden at the beginning 
     self.tableView.contentOffset = CGPoint(x: 0, y: controller.searchBar.frame.size.height) 

     return controller 
    })() 

Zasadniczo wygląda spodziewanych:

enter image description here

Ale kiedy wchodzi pole tekstowe wyszukiwarki i przewinąć w dół tabeli zobaczyć to wygląda dziwnie. Tło kontrolera wyszukiwania jest przezroczyste.

enter image description here

Próbowałem ustawić barTintColor i backgroundColor ale to nie ma żadnego wpływu.

+0

Wszelkie aktualizacje w tej sprawie? – Airuop

Odpowiedz

0

zestaw paska wyszukiwania w backgroundColor do białego

searchBar.backgroundColor = UIColor.white

+0

Witamy w StackOverflow i dzięki za pomoc. Możesz poprawić swoją odpowiedź, dodając kilka wyjaśnień. –

Powiązane problemy