Take the 2-minute tour ×

I'm working on an app with a custom dialog. Inside of that dialog, there is an image that i set in my code depending on which item in a list view is clicked. Everything in the dialog works. The image shows up along with the buttons and text. However the images I am using remain much smaller than I'd like. I tried to follow this tutorial, but it won't scale the images up past a point. It will scale them down, but not up. I have tried various methods to fix this including different android:scaleType="", but to no avail. Any help would be greatly appreciated. I would like to avoid setting the size individually because i have over 400 images, I would like them to be set once and done in xml.

android:layout_width="wrap_content" android:layout_height="wrap_content">

<ImageView android:id="@+id/ImageView01"
 android:layout_width="wrap_content" android:layout_height="wrap_content"
 android:layout_centerHorizontal="true" />

 <ScrollView android:id="@+id/ScrollView01"
 android:layout_width="wrap_content" android:layout_below="@+id/ImageView01"

 <TextView android:id="@+id/TextView01"
 android:layout_width="wrap_content" android:layout_height="wrap_content"
 android:paddingLeft="5dp" />


 android:textColor="#ffffff" />

 android:textColor="#ffffff" />

share|improve this question
Have you tried setting the width and height of the RelativeLayout to match_parent instead of wrap_content? On a side note, why do you have a ScrollView which only contains a TextView? –  Squonk Jul 9 '13 at 0:37
@Squonk The RelativeLayout is a dialog, and the ScrollView is just there in case the text gets too big, so that the user can scroll through it, instead of the layout taking up the whole screen. –  Code_Insanity Jul 9 '13 at 0:42
You're not storing your images in res/drawable/ but in assets/ Right? –  Stephan Branczyk Jul 9 '13 at 0:44
@StephanBranczyk Uh, no. I have made images for multiple screen densities, so I have them in res/drawable/. –  Code_Insanity Jul 9 '13 at 0:50
use Resize Image Tools, make the image bigger, so you don't worry it doesn't scale up –  Gina Jul 9 '13 at 3:00
add comment

1 Answer

up vote 0 down vote accepted

Put your images in the /res/drawable-nodpi folder (or change the code accordingly and place them in the assets/ folder).

Remove those images from the other drawable/ folders. Tell us their dimensions. Test them on different screens in different orientations. Since these images will be taking the entire width of the screen, you may have to tailor your layout for the different size buckets, but I doubt you'll need to do that for the different density buckets.

share|improve this answer
Thanks. I moved all the images to drawable-nodpi and all the images increased significantly in size. Thanks for the tip! –  Code_Insanity Jul 9 '13 at 15:24
add comment

Your Answer


