As you know the order of views in linear layout is related to the order of them in xml file. Is it possible to change that order with java code by something like indexing?
I would try to remove all views with removeView(view)
and add them with addView(childView, index)
in that order you like.
Remove the view, then add it to its new position by calling addView (View child, int index)
, specifying the position at which to add the view.
bringToFront()
may be useful, as it changes the order for order-dependent layouts, too
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With