• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps RelativeLayout within 2 LinearLayout in android

krishnaveni

Well-Known Member
Dec 16, 2011
158
0
chennai
Hi .,
I have developed one expandablelistview android example. Here am faced some designing problem.
Here i wish to need the o/p in this format:
* Order info
Payment_method:
Payment_method
Subtotal
Subtotal
* CustomerInfo
Firstname
Firstname
Lastname
Lastname
Phone
Phone
Here 2 expandablelistview group is available.They are

  1. orderinfo and
  2. Customerinfo.Here i wish to click the first group, which means the payment_method and subtotal should be displayed.

When the second group is clicked, the firstname, lastname and phone should be displayed. But here i have to run the app and click the first group and then the payment_method and subtotal is displayed successfully. After that some empty spaces also displayed here. Then i have to click the second group means first displayed some empty spaces after that only displayed firstname,lastname and phone. How can i resolve this error? .

Here i wish to need the o/p is the childview have to display without empty spaces.

please refer below link.this is my o/p for now.
2012-10-01_0938 - Demotrace's library

please help me.how can my childview is display without empty spaces.please give me solution for this.
This is my layout code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent" 
android:background="#666666"
  >

<LinearLayout
    android:id="@+id/linear_layout1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/payment_method1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="5dp"
        android:text="payment_method"
        android:textSize="15dip"
        android:textStyle="bold"
        android:textColor="#FFFFFFFF"
        />

    <TextView
        android:id="@+id/payment_method"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="75dp"
        android:text="payment_method"
        android:textColor="#10bcc9"
        android:textSize="15dip"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/subtotal1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="5dp"
        android:text="subtotal"
        android:textColor="#FFFFFFFF"
        android:textSize="15dip"
        android:textStyle="bold"
         />

    <TextView
        android:id="@+id/subtotal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="65dp"
        android:text="subtotal"
        android:textColor="#10bcc9"
        android:textSize="15dip"
        android:textStyle="bold" />
</LinearLayout>


<LinearLayout
    android:id="@+id/linear_layout2"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/linear_layout1"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/firstname1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="5dp"
        android:text="Firstname"
        android:textColor="#FFFFFFFF"
        android:textSize="15dip"
        android:textStyle="bold"
       />

    <TextView
        android:id="@+id/firstname"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="65dp"
        android:text="first_name"
        android:textColor="#10bcc9"
        android:textSize="15dip"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/lastname1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="5dp"
        android:text="Lastname"
        android:textColor="#FFFFFFFF"
        android:textSize="15dip"
        android:textStyle="bold"
         />

    <TextView
        android:id="@+id/lastname"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="65dp"
        android:text="last_name"
        android:textColor="#10bcc9"
        android:textSize="15dip"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/phone1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="5dp"
        android:text="Phone"
          android:textColor="#FFFFFFFF"
        android:textSize="15dip"
        android:textStyle="bold" 
         />

    <TextView
        android:id="@+id/phone"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="65dp"
        android:text="phone"
      
        android:textColor="#10bcc9"
        android:textSize="15dip"
        android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
Thanks.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones