Android: Mirroring a View

前端 未结 2 1054
北恋
北恋 2021-01-28 13:02

I have a view I need to flip vertically, or mirror. There\'s plenty of information out there about mirroring a single bitmap by scaling it by -1 and translating for the offset,

2条回答
  •  故里飘歌
    2021-01-28 13:28

    You could simply create a Canvas out of a Bitmap and then invoke your root view's View.draw(Canvas) method. This will give you a snapshot of the view hierarchy in a Bitmap. You then apply the aforementioned transformations to mirror the image.

提交回复
热议问题