简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM