I have a LinearLayout within a ScrollView in the xml file. I need to paint and write within the ScrollView so I've created a view in the layout and have been able to paint and write inside using: canvas.draw() and canvas.drawText(), my problem comes when writing text with canvas are not clearly the letters, so I need to add a TextView to the layout of the ScrollView from the class, without knowing very well how to do it. Paste the code:
public class Calendario extends Activity{ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calendar); LinearLayout layout = (LinearLayout) findViewById(R.id.layout); MyView v = new MyView(this); layout.addView(v,250,2000); } private class MyView extends View{ public MyView(Context context) { super(context); } protected void onDraw(Canvas canvas) { onDrawMethod(); //Here draw and write text// } } }
A picture of what I need: I need only add textviews inside Thankss