如何让一切眼前一亮? [英] How to bring view in front of everything?

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

问题描述

我有活动和很多小部件,其中一些有动画,并且由于动画,一些小部件正在一个接一个地移动(平移).例如,文本视图在一些按钮上移动...

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 . . .

现在问题是我希望按钮始终位于前面.当文本视图移动时,我想移动到按钮后面.

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天全站免登陆