开发者

Display a transparent Activity in Android?

开发者 https://www.devze.com 2023-03-31 13:36 出处:网络
How can I set (by code) an Activity to be transparent? I want the activity to become transparent when the user clicks a开发者_如何学编程 button. Is it possible?You can use setTheme (android.R.style.Th

How can I set (by code) an Activity to be transparent? I want the activity to become transparent when the user clicks a开发者_如何学编程 button. Is it possible?


You can use setTheme (android.R.style.Theme_Translucent)

But keep the api docs in mind:

Set the base theme for this context. Note that this should be called before any views are instantiated in the Context (for example before calling setContentView(View) or inflate(int, ViewGroup)).

Source

0

精彩评论

暂无评论...
验证码 换一张
取 消