我想在相当简单的布局中添加8个文本视图。 我想每行有两个文本视图和四个这样的行。 我的挑战是排列第二,第四,第六和第八个文本视图。 第1,第3,第5和第7个文本视图的文本长度不同。多个文本视图在线性布局中无法正确对齐
我无法排列每行中的seocnd文本视图以便垂直对齐。
基本上,这些文本视图需要在同一行开始垂直对齐无论以往任何时候都行中的第一个文本视图的长度是多少:
有人可以帮忙吗?
这是我的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>