Android 当EditText处于焦点时,屏幕在键入时不断移动
我的编辑文本位于ImageView下面。当我开始在EditText上键入时,屏幕将不会保持不变,并会一直上下滚动,如中所示。另一个问题是键盘覆盖了编辑文本的一部分 这就是我的活动的XML的样子:Android 当EditText处于焦点时,屏幕在键入时不断移动,android,android-edittext,android-softkeyboard,android-screen,Android,Android Edittext,Android Softkeyboard,Android Screen,我的编辑文本位于ImageView下面。当我开始在EditText上键入时,屏幕将不会保持不变,并会一直上下滚动,如中所示。另一个问题是键盘覆盖了编辑文本的一部分 这就是我的活动的XML的样子: <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:focusable="true" android:focusableInTo
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
>
<ImageView
android:id="@+id/display_photo"
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:adjustViewBounds="true"/>
<android.support.design.widget.TextInputLayout
android:id="@+id/caption_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="7dp"
android:theme="@style/LoginFieldLayout"
app:hintTextAppearance="@style/MomentLabel">
<android.support.design.widget.TextInputEditText
android:id="@+id/et_start_photo_story_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:adjustViewBounds="true"
android:gravity="bottom"
android:hint="@string/caption_hint"
android:inputType="textNoSuggestions|textMultiLine"
android:lines="8"
android:maxLength="500"
android:minLines="1"
android:paddingBottom="15dp"
android:privateImeOptions="nm"
android:textColor="@color/black"
android:textColorHint="@color/black"
android:textSize="18sp"
android:theme="@style/StartAdventureEditText" />
</android.support.design.widget.TextInputLayout>
我还在清单文件中添加了这一行:android:windowSoftInputMode=“adjustResize”
在androidManifestFile.xml中使用“adjustNothing”,如下所示
<activity
android:name="com.myApp.ui.activity.MainActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden|adjustNothing" />
<activity
在androidManifestFile.xml中使用如下“adjustNothing”
<activity
android:name="com.myApp.ui.activity.MainActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden|adjustNothing" />
<activity
您是否在任何片段中使用EditText我的应用程序正在使用片段,但在此特定活动中未使用。如果您在此屏幕的片段中使用EditText,在此处检查我的答案希望它对您有帮助您是否在任何片段中使用EditText我的应用程序正在使用片段,但不在此特定活动中使用。如果您在该屏幕的片段中使用EditText,请在此处检查我的答案希望它对您有帮助谢谢。这确实解决了我的问题。然而,正如你在视频中看到的,在编辑文本的正下方有一个实时角色计数。当EditText处于焦点时,是否有办法稍微向上滚动屏幕,以使活动字符计数不会被软键盘覆盖?这是因为您有手动快捷键键盘。然而,下面将帮助您截断键盘的高度(禁用建议)。谢谢这确实解决了我的问题。然而,正如你在视频中看到的,在编辑文本的正下方有一个实时角色计数。当EditText处于焦点时,是否有办法稍微向上滚动屏幕,以使活动字符计数不会被软键盘覆盖?这是因为您有手动快捷键键盘。然而,下面将帮助您截断键盘的高度(禁用建议)。