繁体   English   中英

Android:图像视图中的两个图像必须彼此接触

[英]Android: Two Images in their Image View must touch each other

我在两个不同的ImageView中有两个Image,在LinearLayout和垂直方向上有Layout。 现在我想将Frist图像边框(底部到)触摸到其他图像的顶部。 但在android中,默认情况下会在它们之间留出一些空间。

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_launcher" />
<ImageView
    android:id="@+id/imageView2"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_launcher" />

我想要这些图像相互接触。 谢谢

尝试

 android:layout_marginTop="-12dip" 

在第二个imageView和12dip中更改为您自己的数字,请注意它是负数。

第二种方法,使用RelativeLayout可以使您满意。

同时将android:padding设置为“ 0dp”,并将android:layout_marginTop / Bottom设置为“ 0dp”。 那么他们应该没有理由不碰。

还要确保您的资源(png / jpg / etc)的边缘没有额外的透明度,因为这会影响到图片。

暂无
暂无

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

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