如何使活动透明 [英] how to make activities transparent

查看:105
本文介绍了如何使活动透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3 activitie.i希望A请所有的人是透明的。 我已经在价值观文件夹中创建一个styles.xml和连接的folllowing code

i have 3 activitie.i want to amake all of them transparent. i have created a styles.xml in values folder and attached the folllowing code

<resources>
  <style name="Theme.Transparent" parent="android:Theme">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:backgroundDimEnabled">false</item>
  </style>

</resources>

在我的Andr​​oid清单我重视以下code

in my android manifest i have attached the following code

对于所有三种活动

现在我的活动越来越透明,但whne我移动的第一活动第二次活动第二活动我看到的第一个活动的背景

now my activities are getting transparent but whne i move from first activity to second activity to 2nd activity i see the 1st activity in the background

我应该怎么做,让我看到onlt第二届活动,第一次活动是没有看到的背景

what should i do so that i see onlt the 2nd activity and 1st activity is not seen in the background

也可以使我的活动半透明?

also can i make an activity semi transparent?

推荐答案

你的问题是不是在透明的。 当你使用startActivity(意向)发动第二次或第三次活动,你需要添加标志,以意图。 - Intent.FLAG_ACTIVITY_CLEAR_TOP

your problem is not in transparent. when you use startActivity(intent) for launching second or third activity you need add FLAG to intent. - Intent.FLAG_ACTIVITY_CLEAR_TOP

这篇关于如何使活动透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆