TableLayout:ldpi显示不正确的尺寸

时间:2013-07-19 19:32:37

标签: android xml layout tablelayout

图片不正确

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

因为这应该是以相同的高度和宽度对每个图像进行双层运算,但“发件箱”图像小于右图像。这有什么不对? smae代码在mdpi和hdpi

中工作正常
<TableLayout  
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:stretchColumns="1"
        android:background="@color/Grey">

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

                <View android:layout_width="wrap_content" 
                    android:layout_height="wrap_content" 
                    android:background="@drawable/inbox_normal" 
                    android:id="@+id/buttonWeddingDayCheatSheet"
                    android:layout_gravity="bottom"
                    android:adjustViewBounds="true"
                    >
                </View>
                <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">

                <View android:layout_width="wrap_content" 
                    android:layout_height="wrap_content" 
                    android:background="@drawable/ourbox_normal" 
                    android:id="@+id/buttonWddingDayCheatSheet"
                    android:layout_gravity="bottom"
                    android:adjustViewBounds="true"
                    >
                </View>
                <TextView  
                    android:layout_width="fill_parent"  
                    android:layout_height="wrap_content"  
                    android:text="0432"  
                    android:layout_gravity="bottom"  
                    android:gravity="center"  
                    android:textColor="#fff"  
                    android:textSize="50dp" />
            </FrameLayout>
        </TableRow>

</TableLayout>  

2 个答案:

答案 0 :(得分:0)

一切看起来都很正确。尝试清理项目并再次运行。

如果不起作用,请尝试将View高度设置为match_parent,将FrameLayout高度设置为固定高度。

答案 1 :(得分:0)

现在解决了。只需将收件箱列的FrameLayout属性android:layout_height更改为fill_parent

相关问题