Android float 操作按钮出现

标签 android

在我的 Activity 中,当我在操作栏中按下搜索时,软键盘会出现,这是预期的,但问题是我在底部有一个 float 操作按钮,它也会出现,如下所示。这个怎么解决。 enter image description here

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

    <ListView android:id="@android:id/list"
        style="?android:attr/listViewWhiteStyle"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />


    <ImageButton
        android:id="@+id/floating_action_button"
        android:layout_width="@dimen/floating_action_button_width"
        android:layout_height="@dimen/floating_action_button_height"
         android:layout_marginBottom="@dimen/floating_action_button_margin_bottom"
        android:layout_gravity="bottom|center_horizontal"
        android:background="@drawable/floating_action_button"
        android:src="@drawable/ic_messaging_new_message"
        />

</FrameLayout>

最佳答案

尝试在 list 的 Activity 标签中提供 android:windowSoftInputMode="stateAlwaysHidden|adjustNothing"android:windowSoftInputMode="stateAlwaysHidden|adjustPan"

关于Android float 操作按钮出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29774323/

相关文章:

java - 在PAN for Android 中创建蓝牙NAP 和PANU 并基于IP 相互通信

android - Viewpager 被推出屏幕 [CoordinatorLayout] [设计库]

android - 使布局在所有设备上看起来都不错

android - 如何在没有嵌套 IF ELSE 语句的情况下处理 Android onSharedPreferenceChanged

java - 为什么颜色的深浅会改变?

android - 除了 Display.getOrientation() 已弃用之外,Display.getRotation() 和 Display.getOrientation() 之间有什么区别?

android - 带有 HttpsURLConnection 和 SSL 的 NullPointerException

java - Android viewPager使用本地html内存不足

android - ionic 使用 $cordovaFile 读取本地 json 文件

java - 如何在arCore平面中设置3d模型而无需点击