【发布时间】:2018-04-07 13:14:45
【问题描述】:
我正在使用 Picasso 从 url 加载图像,但它会自动调整我的图像大小。我正在使用以下调用:
Picasso.with(getContext())
.load(url)
.placeholder(R.drawable.placeholder)
.into(imgView);
无论 Picasso 调整大小对我来说都很好,但由于这种行为,我无法确定占位符图像的大小。
原始图像大小为 w=185 & h=278,我的占位符图像也是如此。 我应该如何决定占位符图片的大小?
布局如下:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:id="@+id/image"
android:src="@drawable/sample_0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:orientation="vertical"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2015-05-14"
android:textSize="30sp" />
</LinearLayout>
</LinearLayout>
【问题讨论】:
-
我认为最好将
imgView的大小固定为185x278。 -
你能分享你
ImageView的布局参数吗? -
我的 ImageView 在线性布局内。