Android: can't remove vertical gap between images in LinearLayout

ε祈祈猫儿з 提交于 2019-12-02 20:26:52

I found the solution. I needed to add this attribute to the ImageView:

android:adjustViewBounds="true"

add android:scaleType="fitXY" in xml layout.

To do this in a linearlayout
for the top ImageView: android:gravity="bottom"
for the bottom ImageView: android:gravity="top"
Are you sure you don't want to be using a RelativeLayout? If you're trying to align two images to each other, that seems the way to go for down the road imho.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!