gpt4 book ai didi

Android - 如何在软键盘出现时调整弹出窗口

转载 作者:太空宇宙 更新时间:2023-11-03 12:17:22 25 4
gpt4 key购买 nike

without soft keyboard

when soft keyboard shows up

我想在我的布局中复制这种效果。但是在我的布局中,当键盘出现时,我的弹出窗口没有调整。该设备为我调整了下面的主要 Activity ,而不是弹出窗口。

这是我的 popup layout.xml :

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/sfondo_semi_trasparente_scuro">




<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@color/white"
android:orientation="vertical">





<EditText
android:id="@+id/textNomeGiocatoreNewTeam"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:hint="Nome giocatore"/>


<EditText
android:id="@+id/textNumeroMagliaGiocatoreNewTeam"
android:inputType="number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Numero Maglia"/>

<Button
android:id="@+id/buttonConfirmAddNewPlayer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Aggiungi giocatore"
android:layout_gravity="center"/>


</LinearLayout>

有人可以帮助我吗?

最佳答案

试试这个:
popupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

关于Android - 如何在软键盘出现时调整弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30211210/

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