Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6878219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:41:47+00:00 2026-05-27T04:41:47+00:00

In My application XML layout, I have one Relativelayout, In which there are two

  • 0

In My application XML layout, I have one Relativelayout, In which there are two linear Layout. Now I am doing the animation for that both layout. But because thera seems the height different I got some view problem.

So I want to make the same height of the both layout. Below is my XML file.

<!-- ============================================================= -->
            <!-- BOTTLE / PEN LAYOUT -->
            <!-- ============================================================= -->
            <LinearLayout android:layout_height="wrap_content"
                android:layout_width="fill_parent" >

                <RelativeLayout android:layout_height="wrap_content"
                    android:layout_width="fill_parent">
                    <!-- ============================================================= -->
                    <!-- PEN LAYOUT -->
                    <!-- ============================================================= -->
                    <LinearLayout android:orientation="vertical"
                        android:layout_height="wrap_content"
                        android:layout_width="fill_parent"
                        android:id="@+id/pen_layout">

                        <TextView
                            android:text="EF"
                            android:layout_height="wrap_content"
                            android:layout_width="wrap_content"
                            android:layout_gravity="center"
                            android:textColor="#000000"
                            android:layout_marginTop="2dp"
                            android:textSize="10sp"/>

                        <ImageView                 
                            android:id="@+id/save"                 
                            android:layout_width="wrap_content"                 
                            android:layout_height="wrap_content"
                            android:layout_gravity="right"   
                            android:src="@drawable/ink_pen"/>             

                        <TextView
                            android:text="F"
                            android:layout_height="wrap_content"
                            android:layout_width="wrap_content"
                            android:layout_gravity="center"
                            android:textColor="#000000"
                            android:layout_marginTop="2dp"
                            android:textSize="10sp"/>
                        <ImageView                 
                            android:id="@+id/save"                 
                            android:layout_width="wrap_content"                 
                            android:layout_height="wrap_content"
                            android:layout_gravity="right"   
                            android:src="@drawable/ink_pen"/>             

                        <TextView
                            android:text="BOLD"
                            android:layout_height="wrap_content"
                            android:layout_width="wrap_content"
                            android:layout_gravity="center"
                            android:textColor="#000000"
                            android:layout_marginTop="2dp"
                            android:textSize="10sp"/>
                        <ImageView                 
                            android:id="@+id/save"                 
                            android:layout_width="wrap_content"                 
                            android:layout_height="wrap_content"
                            android:layout_gravity="right"   
                            android:src="@drawable/ink_pen"/>             

                        <TextView
                            android:text="ITALIC"
                            android:layout_height="wrap_content"
                            android:layout_width="wrap_content"
                            android:layout_gravity="center"
                            android:textColor="#000000"
                            android:layout_marginTop="2dp"
                            android:textSize="10sp"/>
                        <ImageView                 
                            android:id="@+id/save"                 
                            android:layout_width="wrap_content"                 
                            android:layout_height="wrap_content"
                            android:layout_gravity="right"   
                            android:src="@drawable/ink_pen"/>

                    </LinearLayout> 

                    <!-- ============================================================= -->
                    <!-- BOTTLE LAYOUT -->
                    <!-- ============================================================= -->

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

                        <!-- First Row Bottle -->
                        <LinearLayout android:orientation="horizontal"
                            android:layout_height="wrap_content" android:layout_weight="1"
                            android:layout_width="fill_parent" android:weightSum="2">
                            <ImageView android:layout_height="wrap_content" android:layout_weight="1"
                                android:layout_width="wrap_content" android:src="@drawable/purple_bottle"/>
                            <ImageView android:layout_height="wrap_content" android:layout_weight="1"
                                android:layout_width="wrap_content" android:src="@drawable/red_bottle"/>
                        </LinearLayout>

                        <!-- Second Row Bottle -->              
                        <LinearLayout android:orientation="horizontal"
                            android:layout_height="wrap_content" android:layout_weight="1"
                            android:layout_width="fill_parent" android:weightSum="2">
                            <ImageView android:layout_height="wrap_content" android:layout_weight="1"
                                android:layout_width="wrap_content" android:src="@drawable/gray_bottle"/>
                            <ImageView android:layout_height="wrap_content" android:layout_weight="1"
                                android:layout_width="wrap_content" android:src="@drawable/green_bottle"/>
                        </LinearLayout>

                        <!-- Third Row Bottle -->               
                        <LinearLayout android:orientation="horizontal"
                            android:layout_height="wrap_content" android:layout_weight="1"
                                android:layout_width="fill_parent" android:weightSum="2">
                            <ImageView android:layout_height="wrap_content" android:layout_weight="1"
                                android:layout_width="wrap_content" android:src="@drawable/orange_bottle"/>
                            <ImageView android:layout_height="wrap_content" android:layout_weight="1"
                                android:layout_width="wrap_content" android:src="@drawable/blue_bottle"/>
                        </LinearLayout>

                        <!-- Forth Row Bottle -->               
                        <LinearLayout android:orientation="horizontal"
                            android:layout_height="wrap_content" android:layout_weight="1"
                            android:layout_width="fill_parent" android:weightSum="2">
                            <ImageView android:layout_height="wrap_content" android:layout_weight="1"
                                android:layout_width="wrap_content" android:src="@drawable/black_bottle"/>
                            <ImageView android:layout_height="wrap_content" android:layout_weight="1"
                                android:layout_width="wrap_content" android:src="@drawable/white_bottle"/>
                        </LinearLayout>

                    </LinearLayout>
                </RelativeLayout>
            </LinearLayout>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:41:48+00:00Added an answer on May 27, 2026 at 4:41 am

    Delete the containing RelativeLayout (since it is the only child of your root LinearLayout you don’t strictly need it) or change it to a LinearLayout.

    Then for both the Pen layout and the bottle layout, add the attribute android:layout_weight and set them both to 1.

    Make sure that both the layouts have the height set to MATCH_PARENT

    Now your two layouts should share the space equally between them, thus making them the same height.

    To share the space equally between the children of the Pen and Bottle layouts, I suggest that you set the height of each child to WRAP_CONTENT and the layout_weight of each child to 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one xml file in which I added one relative layout and below
I am trying to design my application so that it has one main.xml layout
I have a client server application that sends XML over TCP/IP from client to
My Application is using logging in two manner....1) programatic 2) log4j.xml I have to
My application requires 2 screens and for this I have created two different XML
I have in my application 2 views: a. res/layout/main.xml - a standard view with
In my android application, I have layout xml files in: layout/ , layout-lan and
I have an application that uses xml config file, where I'm describing layouts for
I have a service application that on startup reads an XML file and starts
I'm writing my first Android application and I have one activity that I'd like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.