Adding a text view to surface view

I use this kind of surface in my application, and now I want to add a text view to this programmatic one. How can i do this.

"<com.csfcse.udrawer.UdrawerDrawingSurface
  android:layout_width="fill_parent" 
  android:layout_height="fill_parent"
  android:id="@+id/drawingSurface" 
        android:layout_gravity="left" />"

Thank......

+3
source share
3 answers

, FrameLayout , SurfaceView, , SurfaceView. FrameLayout LinearLayout TextView. FrameLayout , Z, , . LinearLayout Gravity.CENTER_VERTICAL ( , LinearLayout.

() , SurfaceViews ( ). , Froyo Evo. ( "twirling" SurfaceView Button TextView.

SurfaceView with views overlaying it

: TextView , XML- , addView().

Layout lay = parentLayo.findViewById(R.id.drawingSurfaceParent);
TextView tv = new TextView(this);
tv.setText("New textview");
lay.addView(tv);
+15

This is not possible; SurfaceView cannot contain other views.

+3
source

Source: https://habr.com/ru/post/1785208/


All Articles