如何在 **spriteKit** 中添加 UIView? [英] How can I add UIView in **spriteKit**?
本文介绍了如何在 **spriteKit** 中添加 UIView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 SpriteKit 框架开发一个游戏项目,现在我的要求是我想添加 UIView
I am developing a game project using SpriteKit framework, now my requirement is i want to add UIView
在我的 spriteKit 项目中控制但无法做到.
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];
目前我正在像这样将 UIView 添加到 SKScene,但它不起作用.谢谢
Currently i am adding UIView to SKScene like this but it is not working . thanks
推荐答案
[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];
}];
这篇关于如何在 **spriteKit** 中添加 UIView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文