-1

我将两张图像连续放置,它在 hdpi 和 mdpi 上运行良好,但我尝试在 ldpi 中打开它,布局只是被未知填充干扰(不知道它是什么)

hdpi 和 mdpi 中的正确图像(应如何显示)

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

ldpi 中的错误图像

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

代码是一样的,但不知道在 ldpi 模式下发生了什么。

<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>

在 ldpi 中,它还显示图像的后续行之间的额外填充。

有什么帮助吗?

4

1 回答 1

0

根据之前的评论:

图像不太可能大于视觉上的要求ldpi,从而导致缩小。默认情况下,视图的边界在缩小时不会改变。尝试设置android:adjustViewBounds="true"ImageViews。

于 2013-07-19T21:14:40.853 回答