我有一个线性布局,其中包含一个ImageView和另一个线性布局,后者是屏幕底部的底栏。我在项目中的其他地方使用底栏,我不认为它是问题所在。
问题是ImageView占据了整个屏幕。图像本身并没有,但视图确实如此。我似乎无法解决这个问题。如您在xml中所见,我没有使用fill_parent来设置ImageView,并尝试了所有可能的图像比例缩放类型。
有任何建议吗?如果可以的话,我正在构建Android API 8
编辑:我已更改以下xml,以便您可以完全使用我编写的内容。(这是我在ImageView中使用的图像:http://i.imgur.com/qN5aT.jpg)
问题是ImageView占据了整个屏幕。图像本身并没有,但视图确实如此。我似乎无法解决这个问题。如您在xml中所见,我没有使用fill_parent来设置ImageView,并尝试了所有可能的图像比例缩放类型。
有任何建议吗?如果可以的话,我正在构建Android API 8
编辑:我已更改以下xml,以便您可以完全使用我编写的内容。(这是我在ImageView中使用的图像:http://i.imgur.com/qN5aT.jpg)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#FFFFFF" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitStart"
android:src="@drawable/quote_sample_img" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="This is text" />
</LinearLayout>
</LinearLayout>
这是一个指向图片的链接。