我正在使用Picasso库来加载图片,它的效果很好,但在使用这个库后,图片不适合布局。如果我直接将图片设置到
ImageView
中,则图片将适合布局。是否有任何选项可以在Picasso中传递方法以适应布局?
我正在使用Picasso库来加载图片,它的效果很好,但在使用这个库后,图片不适合布局。如果我直接将图片设置到ImageView
中,则图片将适合布局。是否有任何选项可以在Picasso中传递方法以适应布局?
Picasso.with(getContext())
.load(R.drawable.dddd).
.into(lavdateimageView);
即使我尝试调用以下方法但无用
fit()
,croptinside()
等
XML文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
android:background="#ffffff"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ffffff"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="260dp"
android:layout_marginBottom="3dp"
android:id="@+id/lavdate_image"
android:orientation="vertical"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/lavdateimageView" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="New Text to"
android:padding="3dp"
android:background="#ffffff"
android:textColor="#000000"
android:layout_margin="3dp"
android:textStyle="bold"
android:id="@+id/sss" />
</LinearLayout>
</ScrollView>
</LinearLayout>