Tag: image resizing

使用毕加索将图像调整为全宽和固定高度

我有一个垂直的LinearLayout,其中的一个项目是使用毕加索加载的ImageView 。 我需要将图像的宽度上升到完整的设备宽度,并显示按固定高度(150dp)裁剪的图像的中心部分。 我目前有以下代码: Picasso.with(getActivity()) .load(imageUrl) .placeholder(R.drawable.placeholder) .error(R.drawable.error) .resize(screenWidth, imageHeight) .centerInside() .into(imageView); 我应该把哪个值放入screenWidth和imageHeight (= 150dp)?