我想在相对布局中显示图像(image1为629x470像素),并使用另一个完整的白色图像(image2为1896x470像素)滚动image1以隐藏/显示image1 。使用ImageView在RelativeLayout中隐藏/显示另一个ImageView
我的image1显示正确。但是,image2会自动调整为较小的版本,并将其垂直放置在image1上,因此我无法完全覆盖image1。如何显示image2以便它完全覆盖image1? adjustViewBounds and scaleType没有帮助。
我的布局如下:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/image1" />
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/image2" />
</RelativeLayout>
请建议。
如果你截取了你所得到的结果和模拟结果,它肯定会帮助你得到更好的答案。 – sbichenko