如何将视野摆在一切面前? [英] How to bring view in front of everything?

查看:89
本文介绍了如何将视野摆在一切面前?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我上面有活动和很多小部件,其中一些具有动画,由于这些动画,一些小部件在另一个上移动(翻译)。例如,文本视图在某些按钮上移动。 。

I have activity and a lot of widgets on it, some of them have animations and because of the animations some of the widgets are moving (translating) one over another. For example the text view is moving over some buttons . . .

现在,我要使按钮始终位于前面。并且当textview移动时,我想移到按钮后面。

Now the thing is I want the buttons to be always on the front. And when the textview is moving I want to move behind the buttons.

我无法实现这一点,我尝试了我所知道的一切,而 bringToFront()绝对不会

I can not achieve this I tried everything I know, and "bringToFront()" definitelly doesn't work.

请注意,我不想通过将元素放置到布局的顺序来控制z顺序,因为我根本不能:),布局复杂且我不能将所有按钮都放在布局的开头

note I do not want to control the z-order by the order of placing element to layout cause I simply can't :), the layout is complex and I can not place all the buttons at the begging of the layout

推荐答案

您可以在想要的视图上调用BringToFront()

You can call bringToFront() on the view you want to get in the front

这是一个示例:

    yourView.bringToFront();

这篇关于如何将视野摆在一切面前?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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