无法设置SKView backgroundColor

Kyl*_*cot 12 objective-c ios ios7 sprite-kit skview

我有一个问题,我的SKView的背景颜色(灰色)在场景出现之前被短暂显示.

我通过Storyboard编辑器和我的控制器(self.skView.backgroundColor = [SKColor blueColor])手动尝试设置它,但它仍然是灰色的.这不是可以覆盖的属性吗?

更新#1

这里有一些关于发生了什么的解释:

  1. viewDidLoad被调用并skView在屏幕上显示灰色背景(skView.scene尚未设置).
  2. 我加载了所有游戏的资源(大约需要1秒),在此期间灰色背景可见.
  3. 资产加载后,我加载场景并呈现它(灰色屏幕被替换为场景内容)

视图控制器

- (void)viewDidLoad
{
    [self.activityIndicator startAnimating];
    [self authenticatePlayer];

    self.skView.backgroundColor = [SKColor blueColor];

    // During this time the grey screen is visible as the assets are being loaded and take ~1 second
    // self.skView.scene is NULL here so I cannot set the backgroundColor...

    [GamePlayScene loadSceneAssetsWithCompletionHandler:^{
        [self.activityIndicator stopAnimating];
        self.activityIndicator.hidden = YES;

        CGSize viewSize = self.skView.bounds.size;

        self.gamePlayScene = [[GamePlayScene alloc] initWithSize:viewSize];
        self.adView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

        [self.skView presentScene:self.gamePlayScene];

    }];
    ...
Run Code Online (Sandbox Code Playgroud)

Fil*_*lic 3

恐怕您要么必须用完成的最基本设置(例如设置背景颜色)来呈现场景,然后加载其余部分,要么呈现“正在加载”场景,直到游戏场景加载,然后替换它。