我想防止应用栏在 Edittext 点击时向上推请帮助我防止应用栏滚动,我添加了 android:windowSoftInputMode="adjustResize"和 adjustmentpan 但不起作用,请帮助我。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:id="@+id/act"
android:clickable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context="com.example.admin.easydart.View.Dart">
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_alignParentTop="true"
android:background="#016ba9"
android:layout_height="60dp"
android:layout_width="match_parent">
</android.support.v7.widget.Toolbar>
<RelativeLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_below="@+id/my_toolbar"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/actS"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:clickable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
最佳答案
在 Activity 类的 onCreate 方法中设置:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
关于android - 如何防止Android工具栏在键盘出现时向上移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49253743/