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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:49:04+00:00 2026-05-22T23:49:04+00:00

I would like to realize a LinearLayout in Android like this: { deleted image

  • 0

I would like to realize a LinearLayout in Android like this:

{ deleted image }

but I don’t know how to do.

If I do:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent" 
android:layout_height="60dp" >
<LinearLayout 
    android:orientation="vertical"
    android:layout_width="fill_parent" 
    android:layout_height="60dp" >
    <TextView android:text="TextView" android:id="@+id/item_0"
        android:layout_width="wrap_content" 
        android:layout_height="30dp" >
    </TextView>
    <TextView android:text="TextView" android:id="@+id/item_1"
        android:layout_width="wrap_content" 
        android:layout_height="30dp" 
        android:textSize="18dp"
        android:textColor="#ff0000">
    </TextView>
</LinearLayout>    
<LinearLayout 
    android:layout_width="80dp" 
    android:gravity="right"
    android:layout_height="60dp" >
    <TextView android:text="TextView" android:id="@+id/item_2"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:textSize="20dp"
        android:textColor="#ff0000">
    </TextView>
</LinearLayout>

</LinearLayout>    

The second LinearLayout (on the right) is not shown. I think I would have to use a RelativeLayout, but how can I draw a similar LinearLayout?

This is the layout used for a ListItem in a ListView so every box has to have the same width (hence cannot use wrap_content for the 2 item_0 and item_1 layout wrapper.

  • 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-22T23:49:05+00:00Added an answer on May 22, 2026 at 11:49 pm
     <?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="60dp" >
    
    <LinearLayout 
        android:orientation="vertical"
        android:layout_width="fill_parent" 
        android:layout_height="60dp" 
        android:layout_weight="70">
        <TextView android:text="TextView" android:id="@+id/item_0"
            android:layout_width="wrap_content" 
            android:layout_height="30dp" >
        </TextView>
        <TextView android:text="TextView" android:id="@+id/item_1"
            android:layout_width="wrap_content" 
            android:layout_height="30dp" 
            android:textSize="18dp"
            android:textColor="#ff0000">
        </TextView>
    </LinearLayout>    
    <LinearLayout 
        android:layout_weight="30"
        android:layout_width="80dp" 
        android:gravity="right"
        android:layout_height="60dp" >
        <TextView android:text="TextView" android:id="@+id/item_2"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:textSize="20dp"
            android:textColor="#ff0000">
        </TextView>
    </LinearLayout>
    
    </LinearLayout>  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to realize a construct in MS SQL that would look like this
I would like dynamically (via JavaScript) hide the address bar. I realize this can
I would like to count the access to a resource, but HTTP GET should
I would like to quickly send email from the command line. I realize there
Would like to know what a programmer should know to become a good at
Would like to know the c# code to actually retrieve the IP type: Static
I would like to use the WebClient (or there is another better option?) but
I would like to know if there's a really performance gain between those two
I would like to start a new scene on cocos2d, but I want to
I would like to know what is the best practice for informing a user

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.