1
只有第一個嵌套的線性佈局顯示出來,有什麼想法爲什麼?第二個線性佈局內的第一個textView顯示出來,並且佈局是適當的高度,但如果它的內容可以查看則沒有。嵌套的線性佈局沒有顯示
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="100">
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="fill_parent"
android:layout_height="42dp"
android:background="#FAFA25"
android:height="200dp"
android:text="@string/hello"
android:textColor="#222222"
android:textSize="20dp" />
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/width" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/totalWidth"
android:layout_marginRight="10dp" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_height="wrap_content"
android:background="#999999"
android:layout_width="fill_parent"
android:layout_margin="10dp"
android:padding="4dp"
android:weightSum="100" >
<TextView
android:id="@+id/textView5"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:text="@string/numOne"
android:layout_weight="62"
android:background="#ffffff"
android:gravity="center"
android:textColor="#222222"
android:layout_marginRight="1dp" />
<TextView
android:id="@+id/textView6"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:text="@string/numTwo"
android:background="#ffffff"
android:layout_weight="38"
android:gravity="center"
android:textColor="#222222"
/>
</LinearLayout>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Calculate" />
</LinearLayout>
</LinearLayout>
是的!謝謝,這是垂直的方向。 Doest方向默認爲水平? – ToraRTC
是的,默認是水平的。 –