Android的浮动操作按钮来了 [英] Android Floating Action Button comes Up
本文介绍了Android的浮动操作按钮来了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的活动我美元在行动栏搜索p $ PSS,软键盘会出现哪些预期,但问题是我在底部一个浮动操作按钮,这也上来了,如下图所示。如何解决这一个。
<的FrameLayout的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:layout_width =match_parent
机器人:layout_height =match_parent
机器人:可聚焦=真正的> < ListView的机器人:ID =@机器人:ID /列表
风格=机器人:ATTR / listViewWhiteStyle
机器人:layout_width =match_parent
机器人:layout_height =match_parent
/>
<的ImageButton
机器人:ID =@ + ID / floating_action_button
机器人:layout_width =@扪/ floating_action_button_width
机器人:layout_height =@扪/ floating_action_button_height
机器人:layout_marginBottom =@扪/ floating_action_button_margin_bottom
机器人:layout_gravity =底部| CENTER_HORIZONTAL
机器人:背景=@绘制/ floating_action_button
机器人:SRC =@绘制/ ic_messaging_new_message
/>< /&的FrameLayout GT;
解决方案
先给的android:windowSoftInputMode =stateAlwaysHidden | adjustNothing
或的android: windowSoftInputMode =stateAlwaysHidden | adjustPan
在你的清单中的活动标签
In my activity when I press on search in action bar, Soft key pad will comes up which is expected but problem is I have one floating action button in bottom which is also coming up as shown below. How to resolve this one.
<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>
解决方案
Try giving android:windowSoftInputMode="stateAlwaysHidden|adjustNothing"
or android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
in your activity tag of your manifest.
这篇关于Android的浮动操作按钮来了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文