0

我正在自定义视图上绘制一条线。但是当我在自定义视图上弹出任何布局时,它正在清除绘制线的一些随机部分。

       @Override
public void onDraw(Canvas canvas) 
{
super.onDraw(canvas);

        canvas.drawLine(0 , 200,700, 200, paint );
}  

这是我的弹出布局代码。

    LayoutInflater layoutInflater = (LayoutInflater)getBaseContext().getSystemService(LAYOUT_INFLATER_SERVICE);  
       popupView = layoutInflater.inflate(R.layout.unavailablepopup, null);  
       DoneBtn    =  (Button)popupView.findViewById(R.id.OkBtn);
       popupWindow = new PopupWindow(popupView,LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);      
       popupWindow.showAsDropDown(popupView, 250,250);
       bsweepOpen  = true; 

我对 onDraw() 有疑问。我使用过 Bitmap ,但没有帮助。线图中我缺少的任何其他东西。我正在使用一个 40 毫秒的计时器来使其无效()。

注意:我不想 reDraw(),所以请不要在这上面浪费时间。

4

0 回答 0