在编辑文本上使用键盘时,操作栏会离开屏幕。
我曾尝试在清单中的活动标签上使用 windowSoftInputMode 的一些参数作为adjustresize、adjustPan,但上述方法均无效。
我的xml是
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#ffffff"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context=".MainActivity">
<include
layout="@layout/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="top"
/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".9"
android:id="@+id/scrollView"
android:paddingBottom="@dimen/margin_toolbar"
android:paddingLeft="@dimen/margin_toolbar"
android:paddingRight="@dimen/margin_toolbar"
android:paddingTop="@dimen/margin_toolbar">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/layout1">
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>
<include
layout="@layout/bottom_chat"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".1"
android:layout_gravity="bottom"
/>
</LinearLayout>
我无法解决问题