·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> app软件开发 >> IOS开发 >> IOSUISearchDisplayController点击搜索出现黑条问题解决方案

IOSUISearchDisplayController点击搜索出现黑条问题解决方案

作者:佚名      IOS开发编辑:admin      更新时间:2022-07-23

最近项目遇到一个很奇葩的问题

点击按钮启动 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)];

效果: