0

名称,password1 字段未显示在滚动视图中,其他一切正常在这里是我的 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="wrap_content"
   android:layout_gravity="center"
   android:orientation="vertical" >

    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:orientation="vertical" >

            <EditText
                android:id="@+id/name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
            android:ems="10"
            android:hint="Name" />

        <EditText
            android:id="@+id/password1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/password"
            android:inputType="textPassword" />

        <EditText
            android:id="@+id/password2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/retype"
            android:inputType="textPassword" />

        <EditText
            android:id="@+id/email"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/email"
            android:inputType="textEmailAddress" />

        <TextView
            android:id="@+id/gender"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Gender" />

        <RadioGroup
            android:id="@+id/radiogroup"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >

            <RadioButton
                android:id="@+id/male"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Male" />

            <RadioButton
                android:id="@+id/female"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Female" />
        </RadioGroup>

        <ImageView
            android:id="@+id/capcha"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_launcher" />

        <EditText
            android:id="@+id/typecaptcha"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="Type" />

        <Button
            android:id="@+id/submit"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Submit" />
    </LinearLayout>
</ScrollView>

</LinearLayout>
4

1 回答 1

0

对我来说,密码字段似乎很好(我复制了你的 XML 来测试它)。如果您使用 Eclipse,请尝试 Project>Clean。我有类似的问题。

快乐编码

编辑(结果):

在此处输入图像描述

于 2013-06-12T09:55:00.917 回答