Einzelnen Beitrag anzeigen
Alt 26.04.2010, 11:13   #9 (permalink)
Neuer Benutzer

Registriert seit: 11.06.2009
Beiträge: 12
Abgegebene Danke: 0
Erhielt 1 Danke für 1 Beitrag
Standard AW: ScrollView - Layoutproblem -> dringend!

Hmm not really a elegant solution for the button at the bottom.
A nice solution would be the following:

Code:
<ScrollView 
   android:id="@+id/ScrollView01" 
   android:layout_height="1dip" 
   android:layout_width="fill_parent"
   android:layout_weight="1">
          <RadioGroup android:id="@+id/RadioGroup01" android:layout_width="wrap_content" android:layout_height="wrap_content">
               <RadioButton android:id="@+id/RadioButton01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />
               <RadioButton android:id="@+id/RadioButton11" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Radio Button....." />       
          </RadioGroup>
     </ScrollView>
     <Button 
        android:id="@+id/Button01" 
        android:layout_height="wrap_content" 
        android:layout_width="fill_parent" 
        android:text="A button that should always be at the bottom"/>
Using the weight attribute saves ...well not so nice absolute margins (producing problems when different screensizes (50dip is a LOT for a QVGS screen)). And it saves you the relative layout.

This is easy and good :-)

Greets

VIDEN
__________________
HTC G1 ADP1 / Archos 5 IT
HTC Tattoo / Motorola Milestone
Google Nexus One
viden ist offline   Mit Zitat antworten