android cliprect not work in high version.

i have a problem with a custom view with running on api 15 (Android 4.0.3)

the code:

canvas.clipRect(10,10,100,100, Region.Op.DIFFERENCE);
canvas.drawPaint(myPaint);
fills the full area of the view and not just the DIFFERENCE... it works with api 8 and 9...


XOR, Difference and ReverseDifference clip modes are ignored by ICS if hardware acceleration is enabled.

Just disable 2D hardware acceleration in your view:

myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

你可能感兴趣的:(android cliprect not work in high version.)