Really odd behaviour with TableLayout

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Really odd behaviour with TableLayout

Postby gauntface » Sun Dec 07, 2008 1:32 pm

Hey everyone

I have the need for a row of TextView + EditText with a second row of MapView underneath

[Name: |<----EditText---->|]
[


MapView

]

In my eclipse main.xml view this works perfectly (Apart from Mapview is shrunk (altho is expanded when run in the emulator).

Image

The EditText doesn't appear :-S I figured I'd done something wrong but I cant see what it is.

Image

But if I swap the TextView and EditText box around it works in the emulator as it shows up in eclipse. Does anyone have any ideas as to what I'm doing wrong?

Image

Image

The layout I'm trying to get to work that works in eclipse but not the emulator is:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <TableLayout
  3. xmlns:android="http://schemas.android.com/apk/res/android"
  4. android:layout_height="fill_parent"
  5. android:layout_width="fill_parent">
  6.  
  7.         <TableRow>
  8.        
  9.                 <TextView
  10.                         android:layout_weight="0"
  11.                         android:layout_width="wrap_content"
  12.                         android:layout_height="wrap_content"
  13.                         android:text="Name:"
  14.                         android:layout_marginLeft="10sp"
  15.                 />
  16.        
  17.                 <EditText
  18.                         android:id="@+id/editName"
  19.                         android:layout_weight="1"
  20.                         android:layout_height="wrap_content"
  21.                         android:singleLine="true"
  22.                         android:layout_marginRight="10sp"
  23.                 />
  24.  
  25.         </TableRow>
  26.        
  27.         <TableRow>
  28.  
  29.                 <com.google.android.maps.MapView
  30.                 android:id="@+id/mapview1"
  31.                 android:enabled="true"
  32.                 android:clickable="true"
  33.                 android:apiKey="<-- My API Key -->"
  34.                 android:layout_weight="1"
  35.         />
  36.  
  37.         </TableRow>
  38.  
  39. </TableLayout>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4
gauntface
Junior Developer
Junior Developer
 
Posts: 10
Joined: Tue Nov 11, 2008 11:16 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests