调整卡片视图中的图像大小

时间:2019-04-03 12:09:54

标签: java android

我正在使用Glide显示卡片视图内的图像。卡片视图内的图像的宽度和高度不同,尤其是使用手机摄像头拍摄的图像。如何使它们具有相同的宽度和高度。我设置宽度和高度在xml布局中,但是它不起作用。我提供了图像布局的屏幕截图。  } Here is a Screenshot

这是我的布局XML文件

client$ /healthcheck.sh 2>&1 | ssh user@host tee -a /answer.txt

这是我的ImageAdapter类

   <android.support.v7.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_below="@+id/toolbar"
    android:paddingBottom="0dp"
    app:contentPaddingLeft="0dp"
    app:contentPaddingRight="0dp"
    app:contentPaddingTop="0dp"
    app:cardUseCompatPadding="true"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:transitionName="@+id/profile"
            android:layout_marginTop="10dp"
            android:layout_below="@+id/text_view_name"
            android:layout_width="fill_parent"
            android:layout_height="100dp"
            android:id="@+id/image_view_upload"
            android:adjustViewBounds="true"
            android:clickable="false"
            android:focusable="false"/>

    </RelativeLayout>

    </android.support.v7.widget.CardView>

0 个答案:

没有答案