0

I am putting two images in a row, its goes well on hdpi and mdpi, but I try to open it in ldpi , the layout just get disturbed by unknown padding (dont know what it is)

Correct image in hdpi and mdpi (how it should be displayed)

https://i.stack.imgur.com/OXw9G.png

Wrong image in ldpi

https://i.stack.imgur.com/wR3kw.png

code is the same, but dont know what happening in ldpi mode.

<TableLayout  
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:stretchColumns="*"
        android:background="@color/Grey">

        <TableRow>
            <FrameLayout 
                android:id="@+id/inboxLargeButton"
                android:layout_height="wrap_content"
                android:layout_width="0dp"
                android:layout_weight="1">

                <ImageView android:layout_width="wrap_content" 
                    android:layout_height="wrap_content" 
                    android:src="@drawable/inbox_normal" 
                    android:id="@+id/buttonWeddingDayCheatSheet"
                    android:layout_gravity="center_horizontal">
                </ImageView>
                <TextView  
                    android:layout_width="fill_parent"  
                    android:layout_height="wrap_content"  
                    android:text="2631"  
                    android:layout_gravity="bottom"  
                    android:gravity="center"  
                    android:textColor="#fff"  
                    android:textSize="50dp" />
            </FrameLayout>

            <FrameLayout 
                android:id="@+id/outboxLargeButton"
                android:layout_height="wrap_content"
                android:layout_width="0dp"
                android:layout_weight="1">
                <ImageView android:layout_width="wrap_content" 
                    android:layout_height="wrap_content" 
                    android:src="@drawable/ourbox_normal" 
                    android:id="@+id/buttonShareFavoriteRecipe"
                    android:layout_gravity="center_horizontal">
                </ImageView>
                <TextView  
                    android:layout_width="fill_parent"  
                    android:layout_height="wrap_content"  
                    android:text="0296"  
                    android:layout_gravity="bottom"  
                    android:gravity="center"  
                    android:textColor="#fff"  
                    android:textSize="50dp" />
                </FrameLayout>
        </TableRow>
</TableLayout>

In ldpi, its also showing extra padding between rows in subsecuent rows of images.

Any help?

UsmanAzam
  • 539
  • 4
  • 15
  • It's not unlikely the images are larger than visually required on `ldpi`, resulting in a scale down. By default, the bounds of the view do not change when downscaling. Try setting `android:adjustViewBounds="true"` to the `ImageView`s. – MH. Jul 18 '13 at 19:13
  • Glad too hear! Shall I move the comment to an answer for you to accept? – MH. Jul 18 '13 at 19:38

1 Answers1

0

As per earlier comment:

It's not unlikely the images are larger than visually required on ldpi, resulting in a scale down. By default, the bounds of the view do not change when downscaling. Try setting android:adjustViewBounds="true" to the ImageViews.

MH.
  • 45,303
  • 10
  • 103
  • 116