如何把视图眼前的一切? [英] How to bring view on front of everything?

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

问题描述

我有活动,有很多关于它的小部件,其中一些有动画和动画的,因为一些小部件的正(翻译)一个在另一个之上。例如,文中观点正在通过一些按钮。 。

现在的事情是我想要的按钮总是在前面。而当TextView的移动我想移动背后的按钮。

我不能做到这一点我想我知道的一切,和bringToFront()definitelly不起作用。

请注意,我不想通过放置元件布局,因为我根本无法:)的以控制Z顺序,布局很复杂,我不能把所有的按钮布局<乞讨/ P>

解决方案

您可以在查看通话bringToFront()你想在前面

这是一个例子:

  yourView.bringToFront();
 

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.

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

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

解决方案

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

This is an example:

    yourView.bringToFront();

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

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