我想設置我的android XML這樣http://i.imgur.com/BJZAEaZ.png和我的佈局必須是非常可縮放的所有不同的android屏幕尺寸也需要與所有不同的工作Android版本。屏幕將被鎖定在橫向視圖中,因此您不必擔心縱向視圖。第一組(常規小時數以上)需要一起擴大和縮小以及加班時間。同樣在垂直居中設置完整報告。每組數字/文本都需要在自己的文本視圖中,以便我可以單獨設計它們。會因爲某種原因而對此有所幫助,所以我無法將我的思想包圍在裏面。我對Android XML相當陌生。我嘗試了不同的佈局相對不能根據不同的屏幕尺寸進行縮放,並且由於所有不同的文本視圖和「完整報告」鏈接的關閉,網格佈局給我帶來了很多麻煩。 所以期待解決方案。謝謝你爲今後的任何幫助。(這裏是我與我的代碼現在。)試圖設置我的Android Xml佈局縮放工作
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffe4e4e4"
>
<View android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#ffa9a9a9"
/>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:background="#ffd1d1d1"
android:src="@drawable/top_bottom_border">
<LinearLayout
android:id="@+id/row_1"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
android:text="40"
android:textSize="20sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
android:text="hrs"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
android:text="30"
android:textSize="20sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="min"
android:layout_marginRight="14dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Regular"
android:textSize="14sp"
android:layout_marginRight="4dp"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="View Time Log"
android:layout_marginRight="4dp"
android:textColor="#ff0009ff"
android:gravity="right"/>
</LinearLayout>
<LinearLayout
android:id="@+id/row_2"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="4dp"
android:text="15"
android:textSize="20sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hrs"
android:layout_marginRight="4dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="17"
android:textSize="20sp"
android:layout_marginRight="4dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="min"
android:layout_marginRight="14dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OverTime"
android:textSize="14sp"
android:layout_marginRight="4dp"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:gravity="right"/>
</LinearLayout>
</LinearLayout>
的問題,我有與你的答案os有兩行文字,他們必須一起伸展你的兩個將工作,如果我只是在做一個單獨的行。這裏是,如果我的代碼是正確的,這可能會幫助你更好地理解(我將把代碼添加到頂端) – jared90