image - Android crop imageview -
there imageview
<imageview android:id="@+id/image" android:layout_width="match_parent" android:layout_height="150dp" />
i load image imageview
using picasso
library.
picasso.with(getactivity()).load(url) .config(bitmap.config.rgb_565) .into(imageview);
there problem there padding inside imageview
, loaded image.
i use .fit()
method avoid gap, image stretches , quality losts.
(you can see dark-blue circles ovals now)
the question is: should avoid loosing quality of image , resize directly imageview
. can't add .centercrop()
because left side of image logical safe-zone. can't change layout_height="150dp"
because break layout.
anyway thank you!
look @ imageview:
<imageview android:id="@+id/image" android:layout_width="match_parent" android:layout_height="150dp" />
you forcing image stretch width of parent view (the screen maybe?). try using wrap_content
width , keeping height same. may cause image shrink, desired ux.
@stefs found adding this:
...android:adjustviewbounds="true" />
would help. check out post here.
if want static image sizes, may have deal padding.
Comments
Post a Comment