Android implementation of profile page avatar background fuzzy display package (status bar)

Recently, I want to achieve such an effect, and then take it out to share with you the main pieces of code. I hope you can use it to make it convenient for others and yourself!

first:

To achieve the floating state bar effect, by calling the method in onCreate method of Activity, then the whole layout can be displayed under the entire mobile phone screen. This is the simplest way I feel.

next:

Get the height of the status bar and change the position of the actionbar (I wrote it in the layout, and then set its height from the top in the code to make it look no different from our bar) to the lower part of the status bar

last:

Method for realizing Gaussian Blur effect of background

Here is a tool for adding a round avatar to convert the picture into a circle, which is very convenient

The above is what Xiaobian introduced to you. Android realizes the fuzzy display of the avatar background of the profile page, including the status bar. I hope it will be helpful to you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>