2016-04-03 23 views
0

Bu yüzden arama çubuğum şunun gibi görünüyor ve UISearchController aracılığıyla çağrılıyor. Her şey bir şey dışında iyi çalışıyor. Ben "çirkin" bir çift kullandım saydam olduğu gibi buSaydam durum çubuğu üst üste binen UITableView içeriği

...

gibi, durum çubuğunun altındaki sonuçlarını gösterir arama listeyi aşağı kaydırma Find friends

bu seyir almak için giderir ve bu şekilde çalışıyor ve sorun açıkça translucent = true - parametresinde yatıyor. Sorunuma herkes hızlı bir çözüm bulabilir mi? Başka bir boş, saydam olmayan görünümün üstüne getirilmesi ve beyaz ten rengi olması jsut'un dışında. Ben bugün erken saatlerde başka bir sorun yaşadım ve this sorunun çözümü Böyle nedeni budur ..

func willPresentSearchController(searchController: UISearchController) { 

    if let navBarFont = UIFont(name: "HelveticaNeue-Light", size: 25.0) { 
     let navBarAttributesDictionary: [String: AnyObject]? = [ 
      NSForegroundColorAttributeName: PinkColor, 
      NSFontAttributeName: navBarFont 
     ] 
     self.navigationController?.navigationBar.titleTextAttributes = navBarAttributesDictionary 
    } 

    self.navigationController?.navigationBar.translucent = true 
    self.navigationController?.navigationBar.barTintColor = UIColor.whiteColor() 
    self.navigationController?.navigationBar.backgroundColor = UIColor.whiteColor() 
    searchController.searchBar.backgroundColor = UIColor.whiteColor() 
    self.navigationController?.navigationBar.topItem?.title = "Find Friends" 
    self.refreshControl?.backgroundColor = UIColor.whiteColor() 
    self.refreshControl?.tintColor = self.GrayColor 
} 
func willDismissSearchController(searchController: UISearchController) { 

    if let navBarFont = UIFont(name: "HelveticaNeue-Light", size: 25.0) { 
     let navBarAttributesDictionary: [String: AnyObject]? = [ 
      NSForegroundColorAttributeName: UIColor.whiteColor(), 
      NSFontAttributeName: navBarFont 
     ] 
     self.navigationController?.navigationBar.titleTextAttributes = navBarAttributesDictionary 
    } 

    UIView.animateWithDuration(0.3) {() -> Void in 
     self.navigationController?.navigationBar.translucent = false 
     self.navigationController?.navigationBar.backgroundColor = self.PinkColor 
     self.navigationController?.navigationBar.barTintColor = self.PinkColor 
     searchController.searchBar.backgroundColor = self.PinkColor 
     self.refreshControl?.backgroundColor = self.PinkColor 
     self.refreshControl?.tintColor = UIColor.whiteColor() 
     self.navigationController?.navigationBar.topItem?.title = "Friends" 
    } 
} 

cevap

1

bu deneyin:

self.edgesForExtendedLayout = UIRectEdgeNone; 
İlgili konular