2
使用毕加索将图像调整为全宽和固定高度
我有一个垂直的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)?