I've got a button that when tapped, creates a RelativeLayout with simple Views like text in it. They're all to be contained in a vertical linear layout.
When tapping in succession, multiple relative layouts get created, with the latest layout created stacked below the previous one. I would, however, like to reverse this order - the latest layout gets stacked ABOVE the previous one.
Relative layouts don't have attributes like layout_below etc, however. The only messy way I can do this is with a grid layout, with the latest ones having a row number less than the previous one. Again, this is messy and consumes unnecessarily memory by preloading a bunch of invisible rows.
Does anyone have an elegant way of doing this? I would be extremely grateful!
.addView(View view)to add views to your layout? If yes, you can useaddView(View view, int index), with index 0 to add it to the top.