Removing Image Stretching in Android

When you add a Button with an image background or an imagebutton,it automatically stretches the image.

To solve this,you need to insert the control associated with image file in a LinearLayout.

<LinearLayout android:layout_width="fill_parent" 
android:layout_height="fill_parent">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/alopost" />
</LinearLayout>


There are so many people met with this problem,this trick made my day so i wanted to share it with you


Ebook Download
View all
Learn
View all
Araf Global is a software consultancy company founded in 2016 focusing on cutting edge technologies.