[email protected] wrote:
> 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?

Nothing leaps out at me as indicating a problem with the layout.

I would perhaps start with the hierarchyviewer tool (in the tools/
directory of your SDK; might also have an Eclipse equivalent) and
confirm that your layout is even being loaded, or if there is anything
in there that looks odd (e.g., everything has height of 0).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to