如何把视野摆在眼前? [英] How to bring view in front of everything?

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

问题描述

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

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