我有活动,有很多关于它的小部件,其中一些有动画和动画的,因为一些小部件的正(翻译)一个在另一个之上。例如,文中观点正在通过一些按钮。 。
现在的事情是我想要的按钮总是在前面。而当TextView的移动我想移动背后的按钮。
我不能做到这一点我想我知道的一切,和bringToFront()definitelly不起作用。
请注意,我不想通过放置元件布局,因为我根本无法:)的以控制Z顺序,布局很复杂,我不能把所有的按钮布局
解决方案
您可以在查看通话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();