<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.tablelayoutactivity.TableLayoutActivity"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/r1"
android:layout_width="fill_parent"
android:layout_height="45dp"
android:gravity="center_vertical"
android:layout_alignParentTop="true" >
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="裝車掃描"
android:textStyle="bold"
android:textSize="20dip" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="0"
android:textStyle="bold"
android:textSize="20sp" />
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:textStyle="bold"
android:text="濟南快運分撥" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/r2"
android:layout_below="@+id/r1"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">
<TextView
android:text="離發車時間還有:181:11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
<TableLayout
android:id="@+id/TableLayout01"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:layout_below="@+id/r2"
android:stretchColumns="*"
android:background="#DEDCD2">
<TableRow
android:background="#DEDCD2"
android:layout_margin="0.5dip">
<TextView
android:text="運單號"
android:textSize="10dip" />
<TextView
android:text="型別"
android:textSize="10dip" />
<TextView
android:text="開單"
android:textSize="10dip" />
<TextView
android:text="掃描"
android:textSize="10dip" />
<TextView
android:text="庫存"
android:textSize="10dip" />
</TableRow>
</TableLayout>
<RelativeLayout
android:id="@+id/r3"
android:layout_above="@+id/r4"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">
<TextView
android:text="總票/件:155/494"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:text="實票/件:104/350"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/r4"
android:layout_above="@+id/r5"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">
<TextView
android:text="總重/體:10958.4/64.15"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:text="實重/體:8054.74/45.64"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/r5"
android:layout_above="@+id/r6"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">
<TextView
android:text="時效總重/體:3729.9/24.8"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:text="時效實重/體:2793.5/18.45"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/r6"
android:layout_width="match_parent"
android:gravity="center_vertical"
android:layout_height="50dp"
android:background="#aa1885d9"
android:layout_alignParentBottom="true"
>
<Button
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="回傳"/>
<Button
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="重繪"/>
<Button
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="提交"/>
</RelativeLayout>
</RelativeLayout>

uj5u.com熱心網友回復:
把不顯示的TextView的父布局改成LinearLayout就可以了。layout_weight不能用在RelativeLayout里面。uj5u.com熱心網友回復:
layout_weight="1" 不適用RelativeLayout改成
<LinearLayout
android:id="@+id/r3"
android:layout_above="@+id/r4"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">
<TextView
android:text="總票/件:155/494"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:text="實票/件:104/350"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/r4"
android:layout_above="@+id/r5"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">
<TextView
android:text="總重/體:10958.4/64.15"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:text="實重/體:8054.74/45.64"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/r5"
android:layout_above="@+id/r6"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">
<TextView
android:text="時效總重/體:3729.9/24.8"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:text="時效實重/體:2793.5/18.45"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>

uj5u.com熱心網友回復:
RelativeLayout 不可以用權重比uj5u.com熱心網友回復:
FSG Typ:PW 70 d/A/IP 40 1708Z03-065.011/01SOLORTRON DP2P 415BC33P40 971415-1探頭
FLEXIM FLUXUS F608手流量計SOLARTRON 971415-1
SELCO T2900.0010 AC400V 5A差動保護器
HAWS 8317CTFP 240V/60HZ 304STEEL
ESA GENIO A-001-05-C-N-230-T
BONFIGLIOLI Trasmital
TYPE 7C183KDA87Q4UCLA CODE 2T718C3K087001
BONFIGLIOLI 7C183KDA87Q4UCLA電機
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/235135.html
標籤:Android
