【发布时间】:2014-10-28 07:14:50
【问题描述】:
声明:
[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];
像这样从新的测试应用结果推送(如我所愿):
但从我现有的应用程序(我必须实现的真正应用程序)结果如下:
清除背景颜色在 iOS7 iPhone 和 iPad 下完美运行,即使在 iOS 8 iPhone 上也是如此。我试图找到可以影响外观的 UIAppearance 代理实现,但没有。
我已经尝试了每个 SO 提案,包括 setting the backgroundView to nil 和 they haven't helped。
为什么它可以与新的测试应用程序一起使用,为什么它不能与我现有的应用程序一起使用?和UINavigationController有什么关系?
注意:请不要标记为重复,因为这里的问题与现有问题完全或略有不同。
【问题讨论】:
标签: ios iphone ipad uitableview uibackgroundcolor