我有一个简单的布局,下面给出。我已经将父级(RelativeLayout)背景设置为图片,并且子表格布局设置为白色。出于某种原因,当我设置桌面布局的颜色时,它会使父布局变黑(或为空)。我不确定这里的问题是什么,如果我有线性布局而不是表格布局,情况也是如此。Android中的布局问题
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/mbi33" android:id="@+id/rl" android:clipToPadding="true">
<TableLayout android:id="@+id/tableLayout1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:background="@color/white">
<TableRow android:id="@+id/tableRow4" android:layout_width="wrap_content" android:layout_height="wrap_content">
<Button android:text="Button" android:layout_height="wrap_content" android:id="@+id/button1" android:layout_weight="1" android:layout_width="0dp"></Button>
<Button android:text="Button" android:layout_height="wrap_content" android:layout_weight="1" android:id="@+id/button2" android:layout_width="0dp"></Button>
<Button android:layout_height="wrap_content" android:text="Button" android:id="@+id/button3" android:layout_weight="1" android:layout_width="0dp"></Button>
</TableRow>
</TableLayout>
</RelativeLayout>
任何帮助,将不胜感激。
我改变了相对布局的宽度和高度,它没有任何区别。 – vikramjb
你可以评论行cliptoPadding,看看它会是什么。 – medampudi