当前位置:首页 > 操作系统 > Ios

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)];

效果:

 
 

原文:http://www.cnblogs.com/ios8/p/IOS-UISearchDisplayController.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!