【发布时间】:2012-05-31 17:38:34
【问题描述】:
我在xml 文件的ScrollView 中有一个LinearLayout。我需要在ScrollView 中绘画和写作,所以我在layout 中创建了一个view,并且能够在内部使用:canvas.draw() 和canvas.drawText() 进行绘画和写作,我的问题出现在编写文本时与canvas 不是很清楚的字母,所以我需要在class 的ScrollView 的layout 中添加一个TextView,而不知道该怎么做。
粘贴代码:
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//
}
}
}
我需要的图片:我只需要在里面添加文本视图 谢谢
【问题讨论】:
标签: android layout textview scrollview