Transparent blurry view which blurs layout underneath

后端 未结 5 502
[愿得一人]
[愿得一人] 2020-11-30 18:27

I\'ve got a Linearlayout which I\'ve made transparent, and now I\'m looking for a way to give it a Blur effect, so what\'s ever underneath it gets blurry. Just like the Wind

5条回答
  •  北海茫月
    2020-11-30 19:23

    It is not possible to do it easily, using layout features.

    I would suggest drawing parent view to canvas as described here: How to make any view to draw to canvas? with the foreground view hidden. Then, blur the canvas and draw the foreground view using this data as a background, or a part of it.

    It will be very resource intensive operation if you want this effect to be live. You should at least try caching the blur result.

提交回复
热议问题