In Android, how can I set the order of children in a FrameLayout as they're added?

喜夏-厌秋 提交于 2019-12-06 12:11:19
fifarunnerr

The z-order of children in the FrameLayout depends on the order in which the items are added, according to this thread.

So you could sort the layerNumber, and then add the childrens in the correct order, or you could use the addView(view, index) method.

Not sure if it's the way you want to do it, but you could simply declare your ImageViews wrapped into Relative/LinearLayouts, and setting each Layout an id, you could simply call relativeLayout1.bringToFront() on it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!