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>
Maybe this can help. You can play with the
background color, andtop paddingof eachTextViewto make it the way you want it to be. Hope this helps.