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

  • Home
  • SEARCH
  • 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 8691955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:13:35+00:00 2026-06-13T00:13:35+00:00

I have a problem with relativelayout where its children could use layout_below and layout_weight

  • 0

I have a problem with relativelayout where its children could use layout_below and layout_weight to set its percentage height.

For example, we have a relative layout and inside of it we have three linear layouts with textviews. Now, I would like to set for three of them (linearlayouts) 25,50,25 % of height of total height of relative layout. How could I accomplish it?

I found a solution for weight_sum and and relativelayout (CLICK), but it doesn’t use layout_below.

How can I fix this?

I tried to add additional linearlayout inside of all linearlayouts, but then I am unable use layout_below.

Here is concept picture idea:

Enter image description here

Here is my code:

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_below="@+id/linlay_leftcol_notification_header" >

    <LinearLayout
        android:id="@+id/linlay_leftcol_clock_theday"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >

    <TextView
        android:id="@+id/tv_theday"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="@string/theday"
        android:textColor="#FFFFFF" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linlay_leftcol_clock_thetime"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/linlay_leftcol_clock_theday" >

        <TextView
            android:id="@+id/tv_thetime"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="@string/thetime"
            android:textColor="#FFFFFF" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linlay_leftcol_clock_thenumber_themonth_theyear"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/linlay_leftcol_clock_thetime" >

        <TextView
            android:id="@+id/tv_thenumberofday_themonth_theyear"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="@string/thenumberofday_themonth_theyear"
            android:textColor="#FFFFFF" />
    </LinearLayout>
</RelativeLayout>
  • 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-06-13T00:13:36+00:00Added an answer on June 13, 2026 at 12:13 am

    Try this…

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:background="#ff00ff"
        android:orientation="vertical">
    
        <RelativeLayout
            android:layout_weight="1"
            android:background="#ffff00"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">
            <TextView
                android:id="@+id/textView0"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:text="Hello 1"
                android:textColor="#000000"
                android:textSize="15dp" />
        </RelativeLayout>
    
        <RelativeLayout
            android:layout_weight="2"
            android:background="#00ffff"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">
            <TextView
                android:id="@+id/textView1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:text="Hello 2"
                android:textColor="#000000"
                android:textSize="15dp" />
        </RelativeLayout>
    
        <RelativeLayout
            android:layout_weight="1"
            android:background="#ffff00"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">
            <TextView
                android:id="@+id/textView2"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:text="Hello 3"
                android:textColor="#000000"
                android:textSize="15dp" />
        </RelativeLayout>
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with two Textviews on the same height in a RelativeLayout
I have extended a RelativeLayout with all its constructor.And I have created a layout
I have problems getting some of my views aligned in a relative layout that
I have problem developing with live555. I already build the lib-files and example projects
I'm using a Relative layout as the root or parent container and I have
I have a problem where the spinner I use display correctly in the emulator
I have a horizontal LinearLayout that's programmatically filled with its children. I would like
i have a big problem with a layout in my Android Application. I have
I have implemented a custom Layout that extends RelativeLayout. It displays lots of different
In My application XML layout, I have one Relativelayout, In which there are two

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.