如何更改UITableViewController后面的视图颜色?

时间:2014-03-14 22:09:56

标签: ios uitableview

我想改变"视图"的颜色。在我的表视图后面(视图控制器是一个UITableViewController)。目前,视图是黑色的,所以当我的表视图滑入时,通过推送,我在过渡期间通过透明导航栏看到它。有没有办法改变它的颜色?提前谢谢。

4 个答案:

答案 0 :(得分:2)

我最近也需要在我的应用中执行此操作,并发现:self.navigationController.view.backgroundColor = [UIColor whiteColor];可以解决这个问题

答案 1 :(得分:1)

你能设置tableViewController的背景颜色吗?

yourTableViewController.view.backgroundColor = [UIColor whiteColor];

在您的应用程序中尝试代理

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    self.window.backgroundColor = [UIColor whiteColor];
    // Override point for customization after application launch.
    return YES;
}

答案 2 :(得分:0)

试试这个:

self.view.superview.backgroundColor = [UIColor whiteColor];

答案 3 :(得分:0)

您可以在backgroundColor

backgroundView属性上设置tableView
UIView *backgroundView = [[UIView alloc] initWithFrame:self.view.bounds];
backgroundView.backgroundColor = [UIColor redColor]; 
self.tableView.backgroundView  = backgroundView;
相关问题