Change color without affecting anything previously drawn

前端 未结 2 1147
滥情空心
滥情空心 2020-12-04 00:31

I have the following CustomView I am using for painting in my app:

package com.test.testing;

import android.content.Context;
import android.gra         


        
2条回答
  •  一向
    一向 (楼主)
    2020-12-04 01:02

    Just do one thing always create new instance of your view class view1.paint.setColor(Color.LTGRAY);, then layout.addView(view1); means create new view it will save prevoius one also, its work for me. Very simple!!

提交回复
热议问题