在 Open GL ES 视图上覆盖标签
我试图在我的 Open GL ES 视图上覆盖一个标签(以及将来的 UI 图像),但什么也没有看到,知道为什么吗?用户交互和多点触控已勾选。我很确定它与此 applicationDidFinishLaunching 调用有关,但不确定它可能是什么:
- (void)applicationDidFinishLaunching:(UIApplication*)application
{
CGRect rect = [[UIScreen mainScreen] bounds];
GLViewController *theController = [[GLViewController alloc] init];
self.controller = theController;
[theController release];
GLView *glView = [[GLView alloc] initWithFrame:rect];
[window addSubview:glView];
glView.controller = controller;
glView.animationInterval = 1.0 / kRenderingFrequency;
[glView startAnimation];
[glView release];
[window makeKeyAndVisible];
}
Im trying to overlay a Label (and in the future a UI Image) over my Open GL ES View but nothing is being seen, any idea why? User Interaction and Multi Touch are checked off. Im pretty sure it has something to do with this applicationDidFinishLaunching call but not sure what it could be:
- (void)applicationDidFinishLaunching:(UIApplication*)application
{
CGRect rect = [[UIScreen mainScreen] bounds];
GLViewController *theController = [[GLViewController alloc] init];
self.controller = theController;
[theController release];
GLView *glView = [[GLView alloc] initWithFrame:rect];
[window addSubview:glView];
glView.controller = controller;
glView.animationInterval = 1.0 / kRenderingFrequency;
[glView startAnimation];
[glView release];
[window makeKeyAndVisible];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您对 addSubview: 的调用将 GLView 实例置于层次结构中任何其他视图的前面。请使用 insertSubview: 方法之一,或者将 GLView 添加到窗口后将其发送到后面。
Your call to addSubview: puts the GLView instance in front of any other views in the hierarchy. Use one of the insertSubview: methods instead or send your GLView to the back after adding it to the window.