Android Fit image to full width using Picasso library -
i using picasso library load images , working fine after using library image not fit layout .if set image directly image view image fit layout.is there option pass method in picasso fit image layout
picasso.with(getcontext()) .load(r.drawable.dddd). .into(lavdateimageview);
even tried pass following method no use
fit()
,croptinside()
etc
xml file
<?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>
i had same problem tried works fine
picasso.with(getcontext()).load(image_url) .fit() .centercrop() .into(imageview);
Comments
Post a Comment