IOS UISearchDisplayController 點擊搜索出現黑條問題解決方案


最近項目遇到一個很奇葩的問題

點擊按鈕啟動 presentViewController 的時候出現下圖效果:

代碼:

 

  1. AddFriendViewController *addFriendVC = [[AddFriendViewController alloc] init];  
  2.    UINavigationController *nav =[[UINavigationController alloc] initWithRootViewController:addFriendVC];  
  3.    [self presentViewController:nav animated:YES completion:nil];  
  4.    [addFriendVC release];  
  5.    [nav release];  

后來才發現問題所在 UINavigationController 的背景顏色是黑色的;

 

為了解決TableView點擊搜索出現的黑條:

代碼: 

  1. AddFriendViewController *addFriendVC = [[AddFriendViewController alloc] init];  
  2.     UINavigationController *nav =[[UINavigationController alloc] initWithRootViewController:addFriendVC];  
  3.     [nav.view setBackgroundColor:UIColorFromRGB(0xC6C6CB)];  
  4.     [self presentViewController:nav animated:YES completion:nil];  
  5.     [addFriendVC release];  
  6.     [nav release];  

改變了Nav的背景色:

 

[nav.view setBackgroundColor:UIColorFromRGB(0xC6C6CB)];

效果:

 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM