Results 1 to 2 of 2
  1. #1
    eLancaster is offline Member
    Join Date
    Jan 2011
    Posts
    93
    Rep Power
    0

    Default I embedded RelativeLayout in a LinearLayout, but can't see widgets in LinearLayout

    This is the XML Code. The problem is that I can't see the textView tvDisplayName, although I don't get any errors. Why is this?
    Thanks for your help?

    Java Code:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/llLinear"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp">
        
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:id="@+id/rlRel">
        <TextView 
            android:id="@+id/tvName"
            android:text="Name:"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="10dp"/>
        <EditText
            android:id="@+id/etName"
            android:text="Enter Name Here"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/tvName"
            android:layout_alignBaseline="@id/tvName">
            </EditText>
    	<Button
    	    android:id="@+id/btnOK"
    	    android:layout_width="wrap_content"
    	    android:layout_height="wrap_content"
    	    android:text="Okay"
    	    android:layout_below="@id/etName"
    	    android:layout_alignRight="@id/etName">
    	    
    	</Button>
        <Button
            android:id="@+id/btnCancel"
            android:text="Cancel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toLeftOf="@id/btnOK"
            android:layout_alignBottom="@id/btnOK"/>
      
          
    </RelativeLayout>
    
          <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/tvDisplayName"
                android:text="Test">
           </TextView>    
        
    </LinearLayout>

  2. #2
    Grkn is offline Member
    Join Date
    Oct 2011
    Posts
    65
    Rep Power
    0

    Default Re: I embedded RelativeLayout in a LinearLayout, but can't see widgets in LinearLayou

    XML is correct but maybe you have a problem with Relative Layout Height =wrap content

    Has your device screen enough space to show Relative Layout Compnents + TextView?

Similar Threads

  1. Custom alignment of SWT widgets inside Composite
    By venkat.eclipse in forum SWT / JFace
    Replies: 2
    Last Post: 02-16-2011, 09:49 PM
  2. getting problem in disposing the widgets
    By thendral m in forum SWT / JFace
    Replies: 7
    Last Post: 01-12-2010, 09:37 AM
  3. How to create widgets on some event
    By sarbuland in forum Advanced Java
    Replies: 0
    Last Post: 02-06-2008, 09:08 PM
  4. How to create widgets dynamically
    By sarbuland in forum Advanced Java
    Replies: 0
    Last Post: 02-06-2008, 09:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •