【发布时间】:2012-01-06 13:59:20
【问题描述】:
我在RelativeLayout 中有一个非常简单的TableLayout。其中一行包含一个设置为“fill_width”的微调器。在模拟器中,这看起来应该是这样,但在我的手机上,它的左右两侧距离全宽都有几个像素。表中的下一行按应有的方式填充。还尝试将微调器移到桌子外,但没有任何改变...
有人有什么建议吗?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="0"
android:shrinkColumns="0"
>
<TableRow>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_span="3"
android:layout_marginTop="10dip"
android:text="@string/project_prompt"
/>
</TableRow>
<TableRow>
<Spinner
android:id="@+id/spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_span="3"
android:prompt="@string/project_prompt"
/>
</TableRow>
<TableRow>
<Button
android:id="@+id/button_addproject"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1"
android:text="Ny"
android:onClick="selfDestruct"
/>
<Button
android:id="@+id/button_modifyproject"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1"
android:text="Rediger"
android:onClick="selfDestruct"
/>
<Button
android:id="@+id/button_deleteproject"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1"
android:text="Slett"
android:onClick="selfDestruct"
/>
</TableRow>
</TableLayout>
<Button
android:id="@+id/button_connect"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_centerInParent="true"
android:text="@string/connect"
/>
<ImageView
android:src="@drawable/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
/>
</RelativeLayout>
【问题讨论】:
-
你能发布你的布局 XML 吗? ..我可以在我的设备上为你试一试..