Skip to content Skip to sidebar Skip to footer

Framelayout In Reverse

I'm trying to figure out how to alter the way FrameLayout stacks it's children. Currently it is newest on top (FIFO). I'd like to change it such that the newest child is on the bo

Solution 1:

Use setChildrenDrawingOrderEnabled(true) and override getChildDrawingOrder with:

@OverrideprotectedintgetChildDrawingOrder(int childCount, int i) {
        return childCount - 1 - i;
    }

Please, take a look at the fork I did from your code and test it.

Post a Comment for "Framelayout In Reverse"