该声明:
[tableView setBackgroundColor:[UIColor clearColor]];
有no effect only on iPad especially with iOS8 with my existing App only
。只是为了测试一下,我创建了一个新的测试应用程序只是为了查明问题但是it works
。我创建了一个这样的UIViewController
类:
@implementation TestViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self.view setBackgroundColor:[UIColor purpleColor]];
UITableView *aTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 100, 300, 300) style:UITableViewStylePlain];
[aTableView setBackgroundColor:[UIColor clearColor]];
[self.view addSubview:aTableView];
}
@end
并使用以下语句推送 ist:
[self.navigationController pushViewController:[TestViewController new] animated:YES];
从这样的新测试应用结果推送(如我所愿):
但从我现有的应用程序(我必须实现的真正应用程序)结果如下:
即使在 iOS 8 iPhone 下,清除背景颜色在 iOS7 iPhone 和 iPad 下也能完美运行。我试图找到可以影响外观的 UIAppearance 代理实现,但没有。
我已经尝试了几个 SO 建议,包括setting the backgroundView to nil
和they haven't helped
。
为什么它可以与新的测试应用程序一起使用,为什么它不能与我的现有应用程序一起使用?有什么关系UINavigationController
吗?
注意:请不要标记为重复,因为这里的问题与现有问题完全或略有不同。