我是android新手,我有一个关于relativeLayout的问题,相对Lyout中的所有视图都没有显示:editTexts和spinners,我看不到错误在哪里: (Android RelativeLayout视图不可见
这里是XML文件:。
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.01"
android:orientation="horizontal"
android:padding="10dp" >
<EditText
android:id="@+id/fname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:hint="@string/fname"
android:inputType="text"
android:textSize="12sp"
/>
<EditText
android:id="@+id/lname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:hint="@string/lname"
android:inputType="text"
android:textSize="12sp"
android:layout_toRightOf="@+id/fname"
/>
<Spinner
android:id="@+id/catspin"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:entries="@array/cat"
android:prompt="@string/cat"
android:layout_below="@+id/fname"
/>
<Spinner
android:id="@+id/rolespin"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:entries="@array/role"
android:prompt="@string/role"
android:layout_toRightOf="@+id/catspin"
/>
<EditText
android:id="@+id/oparea"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:hint="@string/oparea"
android:inputType="text"
android:textSize="12sp"
android:layout_below="@+id/catspin"
/>
<EditText
android:id="@+id/job"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:hint="@string/job"
android:inputType="text"
android:textSize="12sp"
android:layout_below="@+id/oparea"
/>
<EditText
android:id="@+id/phone"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:hint="@string/phone"
android:inputType="text"
android:textSize="12sp"
android:layout_below="@+id/job"
/>
<EditText
android:id="@+id/email"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:hint="@string/email"
android:inputType="text"
android:textSize="12sp"
android:layout_toRightOf="@+id/phone"
/>
</RelativeLayout>
你试过删除'android:layout_weight'属性吗?你已经将它设置为0.01的根目录布局。 – 2013-05-10 10:50:06
谢谢,它现在的作品^^ – kyokotsu 2013-05-10 11:07:19