2011-11-25 74 views
2

我在RelativeLayout中有一個非常簡單的TableLayout。其中一行包含一個設置爲「fill_width」的微調器。在模擬器中,它看起來應該是這樣,但在我的手機上,它的左右兩側都是全寬的幾個像素。表格中的下一行填滿它們應該的位置。也嘗試將桌面上的微調移動到外面,但它沒有改變任何東西...Android微調器沒有真正填充寬度

任何人有任何提示?

<?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> 
+1

你可以發佈你的佈局XML嗎? ..我可以嘗試在我的設備上爲你.. – Joe

回答

0

我沒有解決方案,但可以確認。我只是在我的設備和模擬器上的一個自己的應用程序中進行了檢查。這對我來說並不是那麼糟糕,但你可以看到差異。

我認爲這是系統UI的性質。我認爲微調正在使用9補丁圖像,如果這個定義了填充,我認爲沒有多少可以做到。例如。按鈕在我的設備上的行爲方式相同。