android - how to show imageview with no white space -


my imageview not show on imageview width see image show white space http://imgur.com/3fdxgij want show mageview shape http://imgur.com/g8uei4b , image show full in imageview no white space below code please me

<imageview     android:id="@+id/test_button_image"     android:layout_width="80dp"     android:layout_marginleft="10dp"     android:layout_margintop="10dp"     android:layout_marginbottom="15dp"     android:layout_height="60dp"     android:layout_alignparenttop="true"     android:background="@drawable/border6"     android:src="@drawable/ic_launcher" > </imageview> 

android:adjustviewbounds="true" 

reference: http://developer.android.com/reference/android/widget/imageview.html#attr_android:adjustviewbounds should fix problems. in case scaling not problem, because image scaled. problem container trying possible space inside layout, image cannot expand width because trying keep ratio.

<imageview     android:id="@+id/test_button_image"     android:layout_width="80dp"     android:adjustviewbounds="true"     android:layout_marginleft="10dp"     android:layout_margintop="10dp"     android:layout_marginbottom="15dp"     android:layout_height="60dp"     android:layout_alignparenttop="true"     android:background="@drawable/border6"     android:src="@drawable/ic_launcher" > </imageview> 

this attribute "crop" remaining not used space in imageview.

also should check background image if 9patch image.

i recommend put imageview without background inside framelayout, , set border image framelayout.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -