Putting textview on top of GLSurfaceView

こ雲淡風輕ζ 提交于 2019-12-08 13:46:54

问题


Please point me to any links for putting textview on GLSurfaceView.I want to show some varying number in textview. The GLSurfaceView example i am following http://www.learnopengles.com/android-lesson-one-getting-started/

I have modified OnDraw function as follows to calculate fps.

I want to show this fps on GLSurfaceView but i am not understanding how can i do this.

Regards, Mayank


回答1:


A sample code.

setContentView(view);
    mTextView = new TextView(this);
    mTextView.setText("YourText");
    mTextView.setTextColor(Color.WHITE);
    mTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 32);
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
    params.gravity = Gravity.CENTER;
    addContentView(mTextView, params);


来源:https://stackoverflow.com/questions/24204919/putting-textview-on-top-of-glsurfaceview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!