我是新手,所以请原谅我。我已经尝试过搜索文档和一般的互联网,但我无法弄清楚。这是我的 XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:contentDescription="@string/desc"
android:src="@drawable/my_image" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/hello_world"/>
</RelativeLayout>
它看起来像这样:
我只希望按钮完全不透明,并且看不到背景图像与按钮混合。换句话说,我希望图像位于背景中,并且按钮牢固地显示在其上方。我使用了这两个元素的 alpha 设置,但无法弄清楚。谢谢。