Android:ScrollView中的编辑文本在kayboard出现时从屏幕上消失
我正在尝试创建一个登录屏幕。我使用ScrollView保存输入字段。我有以下xml:Android:ScrollView中的编辑文本在kayboard出现时从屏幕上消失,android,android-edittext,scrollview,Android,Android Edittext,Scrollview,我正在尝试创建一个登录屏幕。我使用ScrollView保存输入字段。我有以下xml: <RelativeLayout ... > <RelativeLayout android:id="@+id/top_menu" ... > <ImageButton ... /> <com.neopixl.pixlui.components.textview.TextView... /> </
<RelativeLayout ... >
<RelativeLayout
android:id="@+id/top_menu" ... >
<ImageButton ... />
<com.neopixl.pixlui.components.textview.TextView... />
</RelativeLayout>
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/top_menu"
android:overScrollMode="always">
<LinearLayout
android:id="@+id/login_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<com.neopixl.pixlui.components.edittext.EditText
android:id="@+id/user_name_email"
android:layout_width="match_parent"
android:layout_height="@dimen/input_height_size"
android:layout_marginEnd="20dp"
android:layout_marginStart="20dp"
android:background="@drawable/edit_text_strock"
android:hint="@string/user_Name_Email_EditText"
android:maxLines="1"
android:paddingLeft="10dp"
android:paddingStart="10dp"
android:textColor="@color/White"
android:textColorHint="@color/White"
android:textSize="@dimen/register_input_text_size"
pixlui:typeface="MuseoSans.otf"/>
<com.neopixl.pixlui.components.edittext.EditText.... />
<com.neopixl.pixlui.components.button.Button... />
<com.neopixl.pixlui.components.textview.TextView... />
<com.neopixl.pixlui.components.textview.TextView... />
<com.neopixl.pixlui.components.textview.TextView... />
<com.neopixl.pixlui.components.button.Button... />
</LinearLayout>
</ScrollView>
</RelativeLayout>
您可以看到完整的xml。
当我点击EditText用户名电子邮件时,它会从屏幕上消失
单击之前:
单击后:
我试过scrollTo(x,y)
和smootcollto(x,y)
但都不起作用
我怎样才能修好它
更新:
adjustPan
可以工作,但我希望它可以与adjustResize
一起工作。
可能吗?对于需要更改的活动,请在清单文件中使用以下行
android:windowSoftInputMode="adjustPan"
按如下所示使用它:
<activity
android:name=".ActivityName"
android:label="title_for_activity"
android:windowSoftInputMode="adjustPan" >
</activity>
希望这有帮助。将此添加到清单文件:
android:windowSoftInputMode="adjustPan"
在目标活动标记中。是否将此属性:android:windowSoftInputMode=“adjustResize | stateAllwayshidden”添加到任何特定原因?