1

NetworkImageView を使用して画像を表示しています。問題は、画像の幅と高さが NetworkImageView に適合しないことです。画像は元のサイズになり、 NetworkImageView に空白が表示されます。画像サイズも変更したくありません..

    <com.android.volley.toolbox.NetworkImageView
    android:layout_gravity="top"
    android:id="@+id/thumb2"
    android:layout_width="match_parent"
    android:layout_height="170dp" />
4

1 に答える 1

0

画像サイズを同じに保ちたい場合は、layout_width と height を wrap_content に設定します。

android:layout_width="wrap_content"
android:layout_height="wrap_content"

android:scaleTypeそれ以外の場合は、自分に合った適切な値を追加してください。

android:scaleType="fitCenter"

また

android:scaleType="centerCrop"

ここで利用可能な値の完全なリストを見ることができますhttp://developer.android.com/reference/android/widget/ImageView.ScaleType.html

于 2015-05-09T05:00:09.120 に答える