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 6082855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:20:08+00:00 2026-05-23T11:20:08+00:00

I would like to divide my screen into 4 equal areas like 田 .Each

  • 0

I would like to divide my screen into 4 equal areas like 田.Each one of the four area is a linear layout.

I tried to use relative layout to hold four linear layout like below:

<?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="fill_parent">
    <LinearLayout
        android:id="@+id/up_left_area"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#ffff66"
    >
        <TextView
            android:id="@+id/label1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="UP LEFT"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/up_right_area"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"    
        android:layout_toRightOf="@id/up_left_area"
        android:background="#ccffff">

        <TextView
            android:id="@+id/label2"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="UP RIGHT"/>
    </LinearLayout>
    <LinearLayout
        android:id="@+id/down_left_area"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_below="@id/up_left_area"
        android:background="#66cc33"
        >

        <TextView
            android:id="@+id/label3"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="DOWN LEFT"/>
    </LinearLayout>
    <LinearLayout
        android:id="@+id/down_right_area"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_below="@id/up_right_area"
        android:layout_toRightOf="@id/down_left_area"
         android:background="#cc6600">

        <TextView
            android:id="@+id/label4"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="DOWN RIGHT"/>
    </LinearLayout>
</RelativeLayout>

With the above xml layout code, I do get 4 areas on the screen, but they are not equal sized. How to modify my code to have equal sized 4 areas on the screen like 田 ?

  • 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-23T11:20:08+00:00Added an answer on May 23, 2026 at 11:20 am

    you could use linear layouts with the same layout_weight=1.

    simplified xml:

    - linearlayout orientation=vertical, layout_width=fill_parent, layout_height=fill_parent
     -- linearLayout orientation=horizontal, layout_weight=1, layout_width=fill_parent, layout_height=fill_parent
     -- -- linearLayout layout_weight=1, layout_width=fill_parent, layout_height=fill_parent
     -- -- -- .... LEFT TOP
     -- -- linearLayout layout_weight=1, layout_width=fill_parent, layout_height=fill_parent
     -- -- -- .... RIGHT TOP
     -- linearLayout orientation=horizontal, layout_weight=1, layout_width=fill_parent, layout_height=fill_parent
     -- -- linearLayout layout_weight=1, layout_width=fill_parent, layout_height=fill_parent
     -- -- -- .... LEFT BOTTOM
     -- -- linearLayout layout_weight=1, layout_width=fill_parent, layout_height=fill_parent
     -- -- -- .... RIGHT BOTTOM
    

    … something like that.

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

Sidebar

Related Questions

I would like to divide my current view into 4 areas (not divide the
I would like to have radio buttons in one radiogroup divided into 2 columns
I would like to divide the content rendered in the default MVC3 layout like
I would like to divide my Qt project into several directories because it is
I have a database of foods, which I would like to divide into a
I would like to print out a html table- it should divide data into
Imagine I have 150 characters long string. I would like to divide it into
I'm using Express for framework. And I would like to divide my configuration to
I would like to build custom tab menu on top of the screen, similar
I would like to divide a stack to stack-frames by looking on the raw

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.