布局内的 OpenGL 视图 [英] OpenGL view inside a layout

查看:19
本文介绍了布局内的 OpenGL 视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置包含 OpenGL 视图的 xml 布局?正如我现在所做的那样,使用 setContentView() 将 OpenGL 视图设置为唯一的视图.但我想创建一个包含 OpenGL 视图的 xml 布局.假设我想主要有 OpenGL 视图,底部有一个小的 TextView.

How do I set up an xml layout where an OpenGL view is part of it? As I do now is set the OpenGL view as the only view with setContentView(). But I would like to create an xml layout that includes the OpenGL view. Lets say I want to have the OpenGL view mainly and a small TextView at the bottom.

这甚至可能吗?或者 OpenGL 视图只能是唯一的视图吗?

Is this even possible? Or can an OpenGL view only be the one and only view?

推荐答案

你可以看看 SurfaceView.它提供了一个嵌入在视图层次结构中的专用绘图表面.另请参阅使用画布绘图.

You might look at SurfaceView. It provides a dedicated drawing surface embedded inside of a view hierarchy. See also drawing with canvas.

这篇关于布局内的 OpenGL 视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆