android - Gravity of BitmapDrawable doesn't work -


i have bitmapdrawable in xml:

<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android"         android:antialias="true"         android:automirrored="true"         android:dither="true"         android:gravity="bottom"         android:filter="true"         android:src="@drawable/test" /> 

i used bitmap imageview below:

<imageview android:id="@+id/detail_img"            android:layout_width="match_parent"            android:layout_height="match_parent"            android:background="@color/coloraccent"            android:src="@drawable/bitmap_drawable"/> 

the result:
enter image description here
can see there padding in top , bottom. , bitmap didn't aligned bottom of imageview, set android:gravity="bottom" in bitmap xml. tried android:gravity="top", didn't work. what's wrong code. googled, didn't find it.

i want know why gravity property in bitmap xml didn't work.

thanks in advance.


i know can set android:scaletype="fitend" imageview can let imageview alignd bottom.

try this:  android:adjustviewbounds.

set true, if want imageview adjust bounds preserve.so, android:adjustviewbounds="true" fixes issue.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -