如何调整两个 ImageView 一个在另一个之上
How to adjust two ImageViews one above the other
我正在尝试添加两张图片,一张在另一张上面,问题是我的 LinearLayout
正在创建一个空白 space,它不会调整那些 ImageView
.我的 activity2.xml
有什么问题?
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/scrollView">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:src="@drawable/ic_launcher" />
<ImageView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:src="@drawable/ic_launcher" />
</LinearLayout>
</ScrollView>
编辑
问题是this
我认为你应该使用 adjustViewBounds
将此行添加到您的 ImageView
android:adjustViewBounds="true"
我正在尝试添加两张图片,一张在另一张上面,问题是我的 LinearLayout
正在创建一个空白 space,它不会调整那些 ImageView
.我的 activity2.xml
有什么问题?
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/scrollView">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:src="@drawable/ic_launcher" />
<ImageView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:src="@drawable/ic_launcher" />
</LinearLayout>
</ScrollView>
编辑
问题是this
我认为你应该使用 adjustViewBounds
将此行添加到您的 ImageView
android:adjustViewBounds="true"