【发布时间】:2017-05-16 16:04:38
【问题描述】:
我编写了一个代码,其中一个圆圈移动,但每当它在 textview 前面移动时,textview 就会出现在他面前,我希望他在 textview 前面。 我在制作 textview 后尝试绘制圆圈,但它没有修复它。 示例:
public MainView(Context context) {
super(context);
}
public void onDraw(Canvas canvas){
((ViewGroup) text.getParent()).removeView(text);//the text was already added to the activity
Paint paint=new Paint();
paint.setColor(Color.WHITE);
canvas.drawCircle(0.0,0.0,500.0, paint);
main.addContentView(text, parameters);//adding a textview named text in the activity
invalidate();
}
【问题讨论】:
标签: android canvas view textview draw