开发者

On Android, how do I use previous Activity's screen as my new Activity's background without translucent background turning black?

Currently I'm using translucent background which allo开发者_JS百科ws for the new Activity to use the previous Activity's screen as the background. However, if I press home and then return to the activity, the translucent background becomes black. Is there a way to avoid the background from turning black?


You can use a theme to make any activity translucent.

<activity android:name=".MyActivity" android:theme="@android:style/Theme.Translucent" ..>
    ..
</activity>

This will make the background for the activity translucent also when you return to it. But obviously you can't control the background of the activity behind it.


using

android:theme="@android:style/Theme.Translucent"

in your activity tag in the manifest file.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜