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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:24:53+00:00 2026-06-07T04:24:53+00:00

I am trying to add 8 text views in my fairly simple layout. I

  • 0

I am trying to add 8 text views in my fairly simple layout.
I would like to have two text views per row and four such rows.
My challenge has been lining up the 2nd, 4th, 6th and 8th text views in this layout.
The text on the 1st, 3rd, 5th and 7th Text views are of different lengths.

I am not able to line up the seocnd text views in each row to be aligned vertically.

Basically, these text views need to start at the same line vertically aligned no matter what ever the length of the first text view in that row is:

can someone help?

Here is my XML.

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/productDetailsLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white"
android:orientation="vertical" >

<include
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    layout="@layout/logo_logout" />


<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="10dp" >

    <TextView
        android:id="@+id/ProductDetailsTitle"
        android:layout_width="wrap_content"
        android:layout_height="43dp"
        android:layout_marginTop="10dp"
        android:background="@color/Navy"
        android:gravity="center"
        android:text="@string/ProductDetailsTitle"
        android:textColor="@color/white"
        android:textSize="20dp"
        android:textStyle="bold" />

    <Button
        android:id="@+id/ProductDetailsEditButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_weight="0.36"
        android:text="Edit"
        android:textSize="20dp" />
</LinearLayout>

<include
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="20dp"
    layout="@layout/product_details_mainpage_part1" />

<include
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="20dp"
    layout="@layout/product_details_mainpage_part2" />

<include
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="20dp"
    layout="@layout/product_details_mainpage_part3" />

<include
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="20dp"
    layout="@layout/product_details_mainpage_part44" />

</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-06-07T04:24:54+00:00Added an answer on June 7, 2026 at 4:24 am

    Maybe this can help. You can play with the background color, and top padding of each TextView to make it the way you want it to be. Hope this helps.

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:baselineAligned="false"
        android:id="@+id/RelativeLayout"
        android:background="#ffffffff"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    
        <LinearLayout
            android:id="@+id/background"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical" >
    
        <TextView
            android:id="@+id/ProductDetailsTitle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#ffffffff"
            android:gravity="center"
            android:paddingTop="50dp"
            android:text="Hello, I am tired" />
    
        <TextView
            android:id="@+id/ProductDetailsTitle2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#ffffffff"
            android:gravity="center"
            android:paddingTop="50dp"
            android:text="Hello" />
    
        <TextView
            android:id="@+id/ProductDetailsTitle3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#ffffffff"
            android:gravity="center"
            android:paddingTop="50dp"
            android:text="Hello" />
    
        <TextView
            android:id="@+id/ProductDetailsTitle4"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#ffffffff"
            android:gravity="center"
            android:paddingTop="50dp"
            android:text="Hello" />
       </LinearLayout>
    
    
       <LinearLayout
           android:id="@+id/background2"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_weight="1"
           android:orientation="vertical" >
    
        <TextView
            android:id="@+id/ProductDetailsTitle5"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"            
            android:background="#ffffffff"
            android:paddingTop="50dp"
            android:gravity="center"
            android:text="Hello" />
    
        <TextView
            android:id="@+id/ProductDetailsTitle6"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#ffffffff"
            android:gravity="center"
            android:paddingTop="50dp"
            android:text="Hello" />
    
        <TextView
            android:id="@+id/ProductDetailsTitle7"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#ffffffff"
            android:gravity="center"
            android:paddingTop="50dp"
            android:text="Hello" />
    
        <TextView
            android:id="@+id/ProductDetailsTitle8"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#ffffffff"
            android:gravity="center"
            android:paddingTop="50dp"
            android:text="Hello, something" />
    
        </LinearLayout>
    </LinearLayout>
    

    enter image description here

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

Sidebar

Related Questions

I have created a Table Layout named table and I am trying to add
I have a ViewFlipper in which I want to add Views (Relative Layout with
I would like to add a page number above the image such as 1
I am trying to add text into a hidden text box in the div
I'm trying yo add text to the editor using some buttons, So actualy I've
I'm trying to add text input's element to my array when user pressed enter
I 'm trying to add text on a specific image. Its working perfectly but
I'm trying to add text to textarea in current pointer position, here's the code
Im trying to add the text contained inside an <li> element when the user
I'm trying to create a view that's full of controls (buttons, text views, labels,

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.