显示键盘时仅调整视图大小的一部分

时间:2019-07-08 09:18:44

标签: kotlin

我有一个包含片段的ViewPager活动。在一个特定的片段中,我有两个自定义视图-ScrollableChat和包含EditText的WriteMessageWidget。当显示键盘并且其他自定义视图保持不变时,我需要具有EditText(WriteMessageWidget)的视图可调整大小。

在Activity清单中将AdjustResize用作windowSoftInputMode时。 ScrollableChat已隐藏,但WriteMessageWidget正确显示。当使用adjustNothing时,情况相反。我需要将两者结合起来。

我还使用了fitsSystemWindows = true / false的各种组合,但似乎没有任何作用。

我试图将布局包装到Coordinator布局中,并且还将视图包装到scrollview中。没有任何帮助。

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

        <androidx.constraintlayout.widget.ConstraintLayout  android:layout_width="match_parent"
        android:layout_height="match_parent">

            <io.fireui.views.ScrollableChat
                android:id="@+id/vScrollableChat"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <io.fireui.views.WriteMessageWidget
                android:id="@+id/vWriteMessage"
                 android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"/>

        </androidx.constraintlayout.widget.ConstraintLayout>
   </layout>

0 个答案:

没有答案
相关问题