How can I add UIView in **spriteKit**?

2019-05-31 06:19发布

I am developing a game project using SpriteKit framework, now my requirement is i want to add UIView

control in my spriteKit project but unable to do it.

UIView *myview=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 280, 480)];
[myview setBackgroundColor:[UIColor redColor]];
[self.scene.view addSubview:myview];

Currently i am adding UIView to SKScene like this but it is not working . thanks

1条回答
Ridiculous、
2楼-- · 2019-05-31 06:47
 [UIView transitionFromView:self.view toView:myview duration:0.25 options:UIViewAnimationOptionTransitionCrossDissolve completion:^(BOOL finished) {
// What to do when its finished.
[self.scene.view addSubview:myview];

}];
查看更多
登录 后发表回答