How to send view to back ? How to control the z-order programmatically?

后端 未结 12 1000
隐瞒了意图╮
隐瞒了意图╮ 2020-12-05 04:12

I have a problem to send the view to back. In Android we have a method like bringToFront(), to place the view on top of the another view. Like that, I want to p

12条回答
  •  旧巷少年郎
    2020-12-05 04:31

    Here is the method I am using to send a View to the back (so opposite of bringToFront, kind of sendToBack):

        private void moveToBack(View myCurrentView) 
        {
            ViewGroup myViewGroup = ((ViewGroup) myCurrentView.getParent());
            int index = myViewGroup.indexOfChild(myCurrentView);
            for(int i = 0; i

    Hope this helps!

提交回复
热议问题