相关疑难解决方法(0)

如何检查Android中软件键盘的可见性?

我需要做一个非常简单的事情 - 找出是否显示了软件键盘.这在Android中可行吗?

android visibility android-softkeyboard

502
推荐指数
9
解决办法
26万
查看次数

键盘显示时如何向上移动整个布局?

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_gravity="bottom"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content" /> 
        </LinearLayout>    

</FrameLayout>  
Run Code Online (Sandbox Code Playgroud)

在清单中:

 android:windowSoftInputMode="adjustPan"
Run Code Online (Sandbox Code Playgroud)

初始行为:

在此输入图像描述

目前的行为:

在此输入图像描述

期望的行为:

在此输入图像描述

如何实现所需的布局行为?adjustResize不适合,因为此选项调整布局大小.

谢谢你的回答!

android android-softkeyboard

20
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×2

android-softkeyboard ×2

visibility ×1