-1
我有下一個XML代碼機器人佈局固定尺寸
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight=".10">
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#aa0000"
android:text="top"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight=".70">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#00aa00">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="50pt"
android:text="center">
</TextView>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="50pt"
android:text="center">
</TextView>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="50pt"
android:text="center">
</TextView>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="50pt"
android:text="center">
</TextView>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="50pt"
android:text="center">
</TextView>
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/white"
android:layout_weight=".20">
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#0000aa"
android:text="bottom"/>
</LinearLayout>
</LinearLayout>
在主的LinearLayout我有三個的LinearLayout。對於第一個LinearLayout,我需要設置100px。對於第三個LinearLayout,我需要設置200px。第二個LinearLayout的所有其他大小。
你似乎沒有問題。如何簡單地設置所需的尺寸? (如果您不知道使用哪些標籤,請查看文檔) – keyser