Hi, Try adding an android:layout_weight="wrap_content" to both your TableLayouts. Also, you can use android:stretchColumns="*" instead of specifying each column. Finally, columns use a 0-base index, not a 1-base index.
On Tue, Jan 27, 2009 at 2:48 AM, <[email protected]> wrote: > Hi, > > I'm struggling with the layouts. I'm trying to have 2 tables and other > things on a screen. Assuming it was the proper way to do so, I've put 2 > TableLayouts inside a LinearLayout. This is what I wrote in the layout.xml > file: > > <? > > xml version="1.0" encoding="utf-8"?> > <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android > android:layout_width="fill_parent" > android:layout_height="fill_parent" > android:orientation="vertical"> > <!-- OUTPUT --> > <TableLayout > android:layout_width="fill_parent" > android:stretchColumns="1,2" > > > <TableRow> > <TextView > android:text="@string/label_1" /> > <TextView > android:gravity="right" > android:id="@+id/value_1" /> > </TableRow> > </TableLayout> > > <View > android:layout_height="20dip" > android:background="@drawable/adds" > /> > <!-- INPUT --> > <TableLayout > android:layout_width="fill_parent" > android:stretchColumns="1,2,3" > > > <TableRow> > <TextView > android:text="@string/label_2" /> > <Spinner android:id="@+id/2" > android:layout_span="2" > android:gravity="right" > android:drawSelectorOnTop="true" > android:prompt="@string/label_2" > /> > </TableRow> > <TableRow> > <TextView > android:text="@string/label_3" /> > <SeekBar android:id="@+id/3" > android:gravity="right" > android:layout_height="wrap_content" > android:max="100" > android:progress="50" > /> > <TextView android:id="@+id/selected_3" > android:gravity="right" > android:paddingLeft="3dip" > android:text="50"/> > </TableRow> > </TableLayout> > </LinearLayout> > > It compiles fine, but at runtime all that I get is...a nice black and empty > screen. > > What is it that I'm doing wrong? Can we have embedded layouts? > > > > Marc Poppleton > ft/nsm/rd/sirp/sis/adi > Innovative software engineer/developer > > Advanced services Design & Interfaces > tél. +332 96 05 16 66 > [email protected] > > > > -- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

