我有一个页面上有多个编辑文本框和下拉框。为了启用滚动,我在清单文件中的活动中加入了
请帮忙告诉我该怎么做或建议我遗漏的东西。
至于代码,只是一些正在工作的编辑文本框。
android:windowSoftInputMode="adjustResize"
。但是当我滚动视图时,我的聚焦的编辑文本框就失去了焦点。也就是说,假设我第一个编辑文本框已经聚焦,然后我向下滚动,再回到第一个编辑文本框,但此时我的第一个编辑文本框已经失去了焦点。有趣的是,当我在API级别4.0中测试相同的事情时,它能正常工作,而在4.0之前则不能。请帮忙告诉我该怎么做或建议我遗漏的东西。
至于代码,只是一些正在工作的编辑文本框。
<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>