anyone knows how can I to make all that images from my list to have the same size/form, more exactly I want all my images to have the square form.
Here is my both XML, sry but I cant post the code here because it's to big and don't let me
anyone knows how can I to make all that images from my list to have the same size/form, more exactly I want all my images to have the square form.
Here is my both XML, sry but I cant post the code here because it's to big and don't let me
Maybe we can refer to this question : How to resize Image in Android?
You may make an array of all your images and than itarete thorugh this array and use the method shown below on all of your files.
Bitmap yourBitmap;
Bitmap resized = Bitmap.createScaledBitmap(yourBitmap, newWidth, newHeight, true);
If you're using a list, you're probably using a custom adapter to inflate the list with the elements (http://developer.android.com/guide/topics/ui/declaring-layout.html#AdapterViews).
So you could just adjust your "listitem.xml" file, so that every created list element has the same size.
Something like:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/imgID"
android:src="@drawable/src_img"
/>
</LinearLayout>
Couldnt you set it in your xml to have a set height/ width and presumably height to also = width? If its like this you might be doing wrap content.
In lisitem XML layout set imagview height to fixed dp like 150,200 dp. Hope this will help you.
try this
<ImageView
android:id="@+id/image"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/db_two" />