如何在 Android 中设置透明页脚

How to set a footer with transparency in Android

我只想在我的应用程序上设置页脚。 我现在拥有的是这样的:

What I have now

它只是一个 XML,在列表视图下有一个 ImageView。

而我想要的是:

What I want

我的图片已经有透明度了...问题应该是我不知道如何"Get a view under a view"

使用 FrameLayout parent to contain both views. Make the ListView fill the parent. Make the ImageView anchor to the bottom of the parent with layout_gravity="bottom" 并水平填充父项。

确保 ImageView 在 ListView 之后定义,这样它就会出现在顶部。

如果我没看错,你有一个透明背景的 imageView,但是绘制图像的 canvas 有一个白色背景。

所以基本上你只需要确保在你给的图像视图中添加带有 "src:" 属性 的图像。

透明背景使用:

android:background="@android:color/transparent"