2014-02-11 55 views
0

我有問題,即我的TableRows之間有大的空間。我怎樣才能刪除它們?我用0dp設置了保證金和填充,但沒有變化。與TableRows之間的大空間

android:layout_marginTop="57dp" 

android:paddingTop="10dp" 

複選框,你做:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:layout_margin="0dp" 
android:padding="0dp" 

> 

<TableLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@drawable/bg_ohne" 



    > 
<TableRow 
    android:layout_weight="1" 
    > 
    <TextView 
     android:id="@+id/textView2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textStyle="bold" 
     android:text="Herzlichen Glückwunsch! Dein Highscore beträgt: " /> 
</TableRow> 
<TableRow 
    android:layout_weight="1" 
    android:paddingTop="10dp"> 
     <TextView 
     android:id="@+id/tvPunkte" 
     android:textStyle="bold" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:text="" /> 
</TableRow> 

<TableRow 
    android:layout_weight="1" 
    > 
    <EditText 
     android:id="@+id/etName" 
     android:ems="10" 
     android:layout_width="wrap_content" 
     android:hint="Dein Name" 
     android:inputType="text|textCapSentences" > 

<requestFocus /> </EditText> 
</TableRow> 

<TableRow 
    android:layout_weight="1" 
    > 
    <EditText 
     android:id="@+id/etEmail" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 

     android:ems="10" 
     android:hint="Deine E - Mail Adresse" 
     android:inputType="textEmailAddress" > 

    </EditText> 
</TableRow> 

<TableRow 
    android:layout_weight="1" 
    > 
    <EditText 
     android:id="@+id/etWohnort" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 

     android:ems="10" 
     android:hint="Dein Wohnort" 
     android:inputType="text|textCapSentences" /> 
</TableRow> 




<TableRow 
    android:layout_weight="1" 
    > 
    <CheckBox 
     android:id="@+id/cbNewsletter" 
     android:layout_marginTop="57dp" 
     android:layout_width="wrap_content" 
     android:text="Für Wüstenfest Newsletter eintragen" 
     android:textStyle="bold" /> 
</TableRow> 
<TableRow 
    android:layout_weight="1" 
    > 
    <Button 
     android:id="@+id/btHighscore" 
     android:layout_width="wrap_content" 
     android:background="@drawable/highscoresenden" 
     android:paddingTop="10dp" /> 
</TableRow> 

<TableRow 
    android:layout_weight="1" 
    > 
    <TextView 
     android:id="@+id/tvVerlosung" 
     android:textStyle="bold" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Um an der Verlosung teilzunehmen, musst du Name, E-Mail Adresse und Wohnort richtig ausfüllen:" /> 
</TableRow> 
</TableLayout> 
</ScrollView> 

enter image description here

回答

0

剛剛從你的XML代碼,無論你在錶行看到刪除此。

+0

不幸的是,我仍然有這樣的空間,就像你在我添加的截圖中看到的那樣! – user896692

+0

然後停止給予不必要的重量。 –

+0

除非我建議您使用線性佈局而不是TableLayout。它會很容易使用。 –