0
我有這種佈局。現在我想用兩個佈局相同的細節,這兩種佈局將是這個佈局裏,這樣我可以顯示由側相同的佈局側佈局 這裏是我的xml文件請幫助我在此:佈局中有兩個佈局橫向Android
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:baselineAligned="false"
android:gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:id="@+id/flightLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/spicejet" />
<TextView
android:id="@+id/flightCompany"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="12sp"
android:text="SpiceJet"
android:textStyle="bold" />
<TextView
android:id="@+id/flightNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="10sp"
android:text="SG-142" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
<TextView
android:id="@+id/departLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="BOS"
android:gravity="center"
android:textStyle="bold" />
<TextView
android:id="@+id/departTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="17:40" />
<TextView
android:id="@+id/departDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Jan 19" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
<TextView
android:id="@+id/arrivalLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SOF"
android:gravity="center"
android:textStyle="bold" />
<TextView
android:id="@+id/arrivalTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="23:45" />
<TextView
android:id="@+id/arrivalDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Jan 19" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
<TextView
android:id="@+id/duration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="6h45m"
android:gravity="center"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center" >
<TextView
android:id="@+id/totalCost"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="30,193"
android:textColor="#0000FF"
android:gravity="center"
android:textStyle="bold" />
<ImageView
android:id="@+id/bookButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="@drawable/book" />
</LinearLayout>
</LinearLayout>
不,我想要這個補全te佈局內主佈局兩側布側 – Developer
我發佈的代碼做你想要的,當我建立它 – Cob50nm
,但在我的設備,它不適合正確使用我使用micromax帆布 – Developer