Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android scrollview未从活动顶部开始_Android_Eclipse_Scrollview - Fatal编程技术网

Android scrollview未从活动顶部开始

Android scrollview未从活动顶部开始,android,eclipse,scrollview,Android,Eclipse,Scrollview,当我打开一个名为“预订”的新活动时,该活动直接集中在scrollview的中心。我试着只将可聚焦(true)设置为顶部,但当我这样做时,编辑文本框不再允许在触摸屏上使用 xmlns:tools=”http://schemas.android.com/tools" android:id=“@+id/容器” android:layout\u width=“匹配父项” android:layout\u height=“match\u parent” android:background=“#0000

当我打开一个名为“预订”的新活动时,该活动直接集中在scrollview的中心。我试着只将可聚焦(true)设置为顶部,但当我这样做时,编辑文本框不再允许在触摸屏上使用

xmlns:tools=”http://schemas.android.com/tools"
android:id=“@+id/容器”
android:layout\u width=“匹配父项”
android:layout\u height=“match\u parent”
android:background=“#000000”
android:focusable=“false”
android:focusableInTouchMode=“false”
android:orientation=“垂直”
工具:context=“com.first.android.spaseafoods.Contact”
工具:ignore=“MergeRootFrame”>

当你提出问题时,只发布对问题至关重要的代码。很酷,可以,第一次出错刚刚在上面的xml中发现了请求的焦点,现在一切都好了,不过花了一段时间!
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:focusable="false"
android:focusableInTouchMode="false"
android:orientation="vertical"
tools:context="com.first.android.spaseafoods.Contact"
tools:ignore="MergeRootFrame" >

<ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:focusable="false"
    android:focusableInTouchMode="false"
    android:scrollbars="vertical" >

   <LinearLayout
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:background="#000000"
       android:focusable="false"
       android:focusableInTouchMode="false"
       android:orientation="vertical" >

        <android.support.v7.widget.Space
            android:id="@+id/space1"
            android:layout_width="20sp"
            android:layout_height="30sp" />

        <TextView
            android:id="@+id/textViewTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:text="Please fill out the following information if you would like to make a reservation, you will receive confirmation within 24 hours."
            android:textColor="#ffffff"
            android:textSize="20sp" />

        <android.support.v7.widget.Space
            android:id="@+id/space2"
            android:layout_width="20sp"
            android:layout_height="30sp" />

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:text="Name *"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#ffffff" />

        <EditText
            android:id="@+id/editTextName"
            android:layout_width="330dp"
            android:layout_height="30dp"
            android:background="@drawable/rounded_edittext"
            android:ems="10" />

        <android.support.v7.widget.Space
            android:id="@+id/space3"
            android:layout_width="20sp"
            android:layout_height="30sp" />

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:text="Phone *"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#ffffff" />

        <EditText
            android:id="@+id/editTextPhone"
            android:layout_width="330dp"
            android:layout_height="30dp"
            android:background="@drawable/rounded_edittext"
            android:ems="10" />

        <android.support.v7.widget.Space
            android:id="@+id/space4"
            android:layout_width="20sp"
            android:layout_height="30sp" />

        <TextView
            android:id="@+id/textView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:text="E-mail"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#ffffff" />

        <EditText
            android:id="@+id/editTextEmail"
            android:layout_width="330dp"
            android:layout_height="30dp"
            android:background="@drawable/rounded_edittext"
            android:ems="10"
            android:inputType="textEmailAddress" />

        <android.support.v7.widget.Space
            android:id="@+id/space5"
            android:layout_width="20sp"
            android:layout_height="30sp" />

        <TextView
            android:id="@+id/textView4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Number of people"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#ffffff" />

        <EditText
            android:id="@+id/editTextPeople"
            android:layout_width="75sp"
            android:layout_height="30sp"
            android:background="@drawable/rounded_edittext"
            android:ems="10"
            android:inputType="number" >

        <requestFocus />
        </EditText>

        <android.support.v7.widget.Space
            android:id="@+id/space6"
            android:layout_width="20sp"
            android:layout_height="30sp" />

        <TextView
            android:id="@+id/textView5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Reservation Date *"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#ffffff" />

        <EditText
            android:id="@+id/editTextDate"
            android:layout_width="150sp"
            android:layout_height="30sp"
            android:background="@drawable/rounded_edittext"
            android:ems="10"
            android:inputType="date" >

            <requestFocus />
        </EditText>

        <android.support.v7.widget.Space
            android:id="@+id/space7"
            android:layout_width="40sp"
            android:layout_height="30sp" />

        <TextView
            android:id="@+id/textView6"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Reservation Time *"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#ffffff" />

        <EditText
            android:id="@+id/editTextTime"
            android:layout_width="150sp"
            android:layout_height="30sp"
            android:background="@drawable/rounded_edittext"
            android:ems="10"
            android:inputType="time" >

            <requestFocus />
        </EditText>

        <android.support.v7.widget.Space
            android:id="@+id/space8"
            android:layout_width="20sp"
            android:layout_height="30sp" />

        <TextView
            android:id="@+id/textView7"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Comments"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#ffffff" />

        <EditText
            android:id="@+id/editTextComments"
            android:layout_width="330dp"
            android:layout_height="100dp"
            android:background="@drawable/rounded_edittext"
            android:ems="10"
            android:inputType="textMultiLine"
            android:lines="4" />

        <android.support.v7.widget.Space
            android:id="@+id/space9"
            android:layout_width="20sp"
            android:layout_height="30sp" />

        <Button
            android:id="@+id/button1"
            android:layout_width="330dp"
            android:layout_height="60dp"
            android:onClick="sendFeedback"
            android:text="Submit"
            android:textColor="#ffffff"
            android:textSize="25sp" />

        </LinearLayout>


</ScrollView>