图像不会在ImageView Android中填充宽度

use*_*656 2 android android-imageview

将照片设置为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>
Run Code Online (Sandbox Code Playgroud)

我试过 android:layout_width="wrap_content"但仍然没有变化.

第一张图片未完整显示.第二个是处于portraid模式,没关系.谢谢.

Nul*_*ion 6

尝试设置

android:scaleType="fitXY"
Run Code Online (Sandbox Code Playgroud)

到你的imageView

  • 尝试删除android:adjustViewBounds =“ true” android:layout_margin =“ 5dp” (2认同)