问题
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