Rajawali 教程08添加用户界面元素

来源:互联网 发布:杨百万软件多少钱 编辑:程序博客网 时间:2024/05/01 09:25

可以添加用户界面元素和布局上的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);    }
User Interface Elements

0 0
原创粉丝点击