Method for Android programming to realize transparent background of activity dialog

This paper describes the method of Android programming to realize the transparent background of activity dialog. Share with you for your reference, as follows:

First, check the relationship between window activities

Omit....

My understanding is

Each activity has a window, that is, the topmost container of the view. An activity is a group of view containers (the child of the window) that provide user interaction

Hierarchy is

So if you need to set actiivy transparency

You need to set windowistranslucent first to make the window transparent.. Then set the background of the window

At this time, whether the activity is transparent depends on whether the background color of the content of the activity is transparent

Just set it in the layout. The default is transparent# 00000000 [if istranslucent is set to false, the background attribute will not work]

For the same dialog transparency, you need to set the following properties

More readers interested in Android related content can view the special topics of this site: activity operation skills summary of Android programming, Android window related operation skills summary, introduction and advanced tutorial of Android development, Android resource operation skills summary, Android database operation skills summary, Android view skills summary, and Android control usage summary

I hope this article will help you in Android programming.

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
分享
二维码
< <上一篇
下一篇>>