简体   繁体   English

如何在Android中设置透明的页脚

[英]How to set a footer with transparency in Android

All I want to do is to set a footer on my app. 我要做的就是在我的应用程序上设置页脚。 What I have now is something like this: 我现在所拥有的是这样的:

What I have now 我现在有什么

Its just a XML with a ImageView under a List View. 它只是在列表视图下带有ImageView的XML。

And what I want is that: 我想要的是:

What I want 我想要的是

My image already have transparency... The problem should be that I dont know a way to "Get a view under a view" 我的图像已经具有透明度...问题应该是我不知道“在视图下获取视图”的方法

Use a FrameLayout parent to contain both views. 使用FrameLayout父级包含两个视图。 Make the ListView fill the parent. 使ListView填充父级。 Make the ImageView anchor to the bottom of the parent with layout_gravity ="bottom" and fill parent horizontally. 使用layout_gravity =“ bottom”将ImageView锚定到父对象的底部,然后水平填充父对象。

Make sure the ImageView is defined after the ListView so it will appear on top. 确保ImageView是在ListView之后定义的,因此它将显示在顶部。

If i get you right, you have an imageView with transparent background but the canvas that the image is painted on has a white background. 如果我说对了,您有一个透明背景的imageView,但是在其上绘制图像的画布有一个白色背景。

So basically you just need to make sure that in the image view you give add the image with "src:" property. 因此,基本上,您只需要确保在图像视图中添加带有“ src:”属性的图像即可。

and for transparent background use: 对于透明背景使用:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM