gpt4 book ai didi

android - 使屏幕底部出现在键盘上方

转载 作者:太空狗 更新时间:2023-10-29 16:14:58 28 4
gpt4 key购买 nike

您好,我正在开发一个包含 3 行的多行 EditText。键盘总是出现在光标下方,但我想始终显示整 3 行,即使我正在写第一行。所以我需要一种方法将 view(screen/layout) 的底部放在键盘的顶部。

现在我使用一个简单的 EditText,它有 3 行和 multiline 标记。

    <EditText
android:id="@+id/editTextMessage"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_marginBottom="2dp"
android:layout_marginLeft="10dp"
android:layout_weight="0.7"
android:background="@drawable/button_background"
android:ems="10"
android:gravity="top|left"
android:hint="Message"
android:inputType="textMultiLine"
android:lines="3"
android:maxLength="140"
android:paddingLeft="5dip"
android:paddingRight="5dip"
android:paddingTop="5dip"
android:textColorHint="@color/JLGreyDarkSend"
android:textSize="14sp">

最佳答案

您可以尝试将 android:windowSoftInputMode="adjustResize" 设置为 Activity 。

关于android - 使屏幕底部出现在键盘上方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31288241/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com