将照片设置到 ImageView 并没有像我预期的那样工作。它没有完全填满宽度。 这是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:orientation="horizontal" >
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/imageCell"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:layout_margin="5dp"
android:src="@drawable/unnamed" />
</LinearLayout>
我尝试使用 android:layout_width="wrap_content"
仍然没有任何变化。
第一张图片显示不完整。第二个是人像模式,没问题。 谢谢。
最佳答案
尝试设置
android:scaleType="fitXY"
到你的imageView
关于android - 图像不填充 ImageView Android 中的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21505768/