配售/重叠(z索引)以上动作条选项卡的视图 [英] Placing/Overlapping (z-index) a view above actionbar tabs

查看:92
本文介绍了配售/重叠(z索引)以上动作条选项卡的视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有画包含它的碎片以外的东西的视图,配置我为<一个href="http://stackoverflow.com/questions/4028270/can-i-draw-outside-the-bounds-of-an-android-canvas">draw使用此外面的内容。 问题是,它的工作原理无处不在,但在动作条和动作条的标签。

I have a view that draw something outside the fragment containing it and i configured it to draw the content outside it using this. The problem is that it works everywhere but on the actionbar and actionbar Tabs.

        mActionBar.addTab(
                mActionBar.newTab()
                        .setCustomView(t)

我使用appCompat和添加标签是这样的:

I am using appCompat and adding tabs this way:

我说:

    android:clipChildren="false"

所有家长的意见,但它不只是动作条和动作条标签的工作。

to all the parent views, but it doesn't work just for actionbar and actionbar tabs..

所需的视图:

但结果是这样的:

推荐答案

这是不容易帮你没有完整的源$ C ​​$ C;反正我可以建议你可能符合你的情况的另一种方法。

It's not easy to help you without the complete source code; anyway I can suggest you an alternative approach which may suit your case.

如果您要创建一个自定义的浮动项目(可能用于教程或暗示),你应该避免改变基础视图的层次和preFER一个的纯覆盖的解决方案

If you are creating a custom floating item (maybe used for a tutorial or an hint), you should avoid to alter the base views hierarchy and prefer a pure overlay solution.

借助 PopupWindow 是什么你需要:

The PopupWindow is exactly what you need:

一个弹出窗口,可以用来显示任意的观点。

A popup window that can be used to display an arbitrary view.

由于 PopupWindow 作用于活动的水平,它应该覆盖所有在当前活动

Since the PopupWindow acts at Activity level, it should overlay everything in your current Activity.

在弹出窗口是在顶部出现一个浮动的容器   当前活动。

The popup window is a floating container that appears on top of the current activity.

您可以在这里找到一个简单的例子

You can find a simple example here.

这篇关于配售/重叠(z索引)以上动作条选项卡的视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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