我正在使用畢加索圖書館加載圖像和它的工作正常,但使用此庫後圖像不適合佈局。如果我直接將圖像設置爲圖像視圖,然後圖像將適合於layout.Is有任何選項傳遞方法畢加索以適應圖像佈局Android使用畢加索圖書館適合全幅圖像
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>
@ Fetal.thanks.but這個我已經嘗試過,但沒有用 – iCoders
@iCoders嘗試它,因爲它是...是指配合和centerCrop的同時,將工作完美 –
@Fetal如果我使用這個,那麼它不會顯示我的圖像。 gues我需要改變我的xml – iCoders