1
Layout được xác định riêng, phương thức onDraw () không được gọi
Tôi đã định nghĩa một lớp như thế : public class TestMyFrameLayout extends FrameLayout{ Paint mPaint; public TestMyFrameLayout(Context context, AttributeSet attrs) { super(context, attrs); } public TestMyFrameLayout(Context context) { super(context); mPaint = new Paint(); mPaint.setColor(Color.GREEN); } protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawCircle(50f, 50f, 30, mPaint); } } và gọi …