如何使上下文动作模式栏覆盖我的布局,而不是“按入”它下来 [英] How to make contextual actionmode bar overlay my layout instead of "pushing" it down

查看:81
本文介绍了如何使上下文动作模式栏覆盖我的布局,而不是“按入”它下来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为我的应用程序实现了自己的视图组。由于各种原因,不能选择使用操作栏,因此在我的视图组中,我自己的操作栏位于顶部,底部位于一个。图片1说明了我当前的布局。

I have implemented my own viewgroup for my application. Using actionbar is not an option for various reasons so in my viewgroup I have my own "actionbars" one on top and one in the bottom. Image 1 illustrates my current layout.

如您所见,布局中有两个edittext,看起来一切正常。

As you can see there are two edittexts in the layout and everything looks ok.

但是当用户在显示的上下文操作模式栏中选择任何编辑文本中的一些文本。图片2对此进行了说明。

However when the user selects some text in any of the edittexts the contextual actionmode bar is shown. Image 2 illustrates this.

这种情况发生时,动作模式栏会向下推我的整个布局以获取其空间。在平板电脑和其他大屏幕设备中,这是可以的,但在较小的设备中,尤其是在可见的软键盘上,剩余高度太小(无法使用横向)。

When this happens actionmode bar "pushes" down my entire layout in order to get its space. In tablets and other large screen devices this is OK but in smaller devices and especially with the soft keyboard visible the remaining height is too small (in landscape orientation is unusable).

我想做的是用动作模式栏覆盖我的布局,而不是如图3所示将其按下。

What I want to do is actionmode bar to overlay my layout instead of pushing it down as shown in Image 3.

有可能吗?

推荐答案

只需将< item name = android:windowActionModeOverlay> true< / item> 添加到您的样式中即可。

Just add <item name="android:windowActionModeOverlay">true</item> to your style.

这篇关于如何使上下文动作模式栏覆盖我的布局,而不是“按入”它下来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆