I\'m porting an app written in a graphics environment that allows drawing to happen outside the bounds of the clipping rectangle. Any way to do this in Android?
If you want to draw text out of bounds in TextView, you should be doing this instead:
It's not working to use clipRect() like @numan's answer because TextView clip it's own rect in onDraw():
if (mShadowRadius != 0) {
clipLeft += Math.min(0, mShadowDx - mShadowRadius);
clipRight += Math.max(0, mShadowDx + mShadowRadius);
clipTop += Math.min(0, mShadowDy - mShadowRadius);
clipBottom += Math.max(0, mShadowDy + mShadowRadius);
}
canvas.clipRect(clipLeft, clipTop, clipRight, clipBottom);
Last but not least, Don't forget to set android:clipChildren="false"
and android:clipToPadding="false"
in your parent ViewGroup