可以添加用户界面元素和布局上的OpenGL面视图。
可以在Activity中进行操作,非常简单:
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mRenderer = new UIExampleRenderer(this); mRenderer.setSurfaceView(mSurfaceView); super.setRenderer(mRenderer); LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); TextView label = new TextView(this); label.setText("Halo Dunia!"); label.setTextSize(20); ll.addView(label); label = new TextView(this); label.setText("Apa kabar?"); label.setTextSize(20); ll.addView(label); label = new TextView(this); label.setText("Blah\n\tblah\n\t\tblah\n\t\t\tblah\n\t\t\t\tblah\n\t\t\t\t\tblah\n\t\t\t\t\t\tblah\n\t\t\t\t\t\t\tblah\n\t\t\t\t\t\t\t\tblah\n\t\t\t\t\t\t\t\t\tblah\n"); label.setTextSize(20); ll.addView(label); mLayout.addView(ll); }