我想要在一个Activity(2)上方有一种半透明的效果,覆盖在另一个Activity(1)上面,并且处于屏幕的顶部位置(4)。
我已经尝试为Activity 2分配这些主题:
<style name="Theme.CustomDialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@android:color/black</item>
</style>
<style name="CustomTheme">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowNoTitle">true</item>
</style>
但结果总是3。
如果我在CustomTheme
中设置<item name="android:windowIsFloating">false</item>
,则结果为2。
有人能告诉我如何获得4吗?谢谢!
更新:这是我的第二个活动布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" android:background="#0000">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="#FFFFFF">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Menu" android:layout_centerHorizontal="true"/>
</RelativeLayout>
</RelativeLayout>