最近項目遇到一個很奇葩的問題
點擊按鈕啟動 PResentViewController 的時候出現下圖效果:

代碼:
- AddFriendViewController *addFriendVC = [[AddFriendViewController alloc] init];
- UINavigationController *nav =[[UINavigationController alloc] initWithRootViewController:addFriendVC];
- [self presentViewController:nav animated:YES completion:nil];
- [addFriendVC release];
- [nav release];
后來才發現問題所在 UINavigationController 的背景顏色是黑色的;
為了解決TableView點擊搜索出現的黑條:
代碼:
- AddFriendViewController *addFriendVC = [[AddFriendViewController alloc] init];
- UINavigationController *nav =[[UINavigationController alloc] initWithRootViewController:addFriendVC];
- [nav.view setBackgroundColor:UIColorFromRGB(0xC6C6CB)];
- [self presentViewController:nav animated:YES completion:nil];
- [addFriendVC release];
- [nav release];
改變了Nav的背景色:
[nav.view setBackgroundColor:UIColorFromRGB(0xC6C6CB)];
效果:
