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

ⅰ亾dé卋堺 提交于 2019-12-08 04:34:31

问题


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:


 [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];

}];


来源:https://stackoverflow.com/questions/27633098/how-can-i-add-uiview-in-spritekit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!