Puzzled with such layout

Put your problem here if it does not fit any of the other categories.

Puzzled with such layout

Postby alphajin » Sat Mar 01, 2008 1:44 pm

I have set a layout like this:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.                 android:layout_width="fill_parent"
  6.  
  7.                 android:layout_height="wrap_content"
  8.  
  9.                 android:padding="10px">
  10.  
  11.        
  12.  
  13.                 <TextView id="@+id/label"
  14.  
  15.                         android:layout_width="fill_parent"
  16.  
  17.                         android:layout_height="wrap_content"
  18.  
  19.                         android:text="Query here:"/>
  20.  
  21.  
  22.  
  23.                 <EditText id="@+id/entry"
  24.  
  25.                         android:layout_width="fill_parent"
  26.  
  27.                         android:layout_height="wrap_content"
  28.  
  29.                         android:layout_below="@id/label"/>
  30.  
  31.        
  32.  
  33. </RelativeLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


but in the application, I didn't see the Textview but only the EditText I think it was covered by EditText.
Can guys help me to find the problem ?

Thanks!
alphajin
Freshman
Freshman
 
Posts: 5
Joined: Tue Feb 19, 2008 2:18 pm

Top

Postby plusminus » Sat Mar 01, 2008 2:26 pm

Hello aplhajin,

yes, as you are using a RelativeLayout and do not define any relative constraints, the Views get drawn above each other.

Creating Layouts using a RelativeLayout is described here :arrow: http://www.anddev.org/viewtopic.php?t=58
(It was made for sdk-version m3, so replace ...id="... with ...android:id"...)

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby alphajin » Sat Mar 01, 2008 2:44 pm

hello plusminus
I dont see any constraints in my xml, could you help me to ponit out them ?
And I could not tell any difference between your xml and mine.

Thanks & Best regards,
Alpha
alphajin
Freshman
Freshman
 
Posts: 5
Joined: Tue Feb 19, 2008 2:18 pm

Postby plusminus » Sat Mar 01, 2008 7:13 pm

Hello aplphajin,

Of course there are differences, like:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. android:layout_below="@id/main_label"
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


Btw: you should use sdk m5 instead of m3 :!:

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 9 guests