Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/218.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 “编辑文本”在滚动时失去焦点_Android_Scroll_Android Edittext - Fatal编程技术网

Android “编辑文本”在滚动时失去焦点

Android “编辑文本”在滚动时失去焦点,android,scroll,android-edittext,Android,Scroll,Android Edittext,我有一个带有各种编辑文本和微调器的页面。要启用滚动,我已将android:WindowsOfInputMode=“adjustResize”与活动一起放入清单中。但是当我滚动我的视图时,我的焦点编辑文本正在失去焦点。我的意思是,假设我有第一个编辑文本聚焦,我向下滚动,回到我的第一个编辑文本,但现在我的第一个编辑文本失去了焦点。有趣的一点是,当我在API level4.0中测试同样的东西时,它工作得很好,而不是在4.0之前 请帮助我做些什么,或者建议一些我遗漏的事情 对于代码来说,只有很少的编辑文

我有一个带有各种编辑文本和微调器的页面。要启用滚动,我已将android:WindowsOfInputMode=“adjustResize”与活动一起放入清单中。但是当我滚动我的视图时,我的焦点编辑文本正在失去焦点。我的意思是,假设我有第一个编辑文本聚焦,我向下滚动,回到我的第一个编辑文本,但现在我的第一个编辑文本失去了焦点。有趣的一点是,当我在API level4.0中测试同样的东西时,它工作得很好,而不是在4.0之前

请帮助我做些什么,或者建议一些我遗漏的事情

对于代码来说,只有很少的编辑文本是wokring

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>



        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello" />

            <EditText
                android:id="@+id/et_user"
                android:layout_width="250dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dp"
                android:singleLine="true" />
        </LinearLayout>
    </LinearLayout>

</ScrollView>

这是android提供的,可能有一些解决办法,但目前它就是这样工作的。所以我能告诉你的是要遵守这个限制。任何更新都会通知您