Jaisuriya R
Jaisuriya R

Reputation: 45

How to add child views to a LinearLayout in reverse order?

I am dynamically creating TextViews and adding those views in a LinearLayout.
I want to show the recently added TextView to the user.
But the problem is that the LinearLayout is adding the views in a top-down manner.
How can I add the child views in reverse order ?

Upvotes: 2

Views: 270

Answers (1)

hata
hata

Reputation: 12523

There is ViewGroup.addView(View child, int index) method. You can insert the newest TextView at the top of LinearLayout.

Upvotes: 1

Related Questions