Reputation: 3264
It is possible to add views to LinearLayout
one after another in upward direction?
Upvotes: 16
Views: 26972
Reputation: 17613
You can add it programmatically with:
LinearLayout layout = (LinearLayout) findViewById(R.id.layout);
layout.addView(newView, index);
You just have to add always with index = 0
Is this the answer to your question?
Upvotes: 28
Reputation: 3848
If you want to keep your views top, relativelayout is another choice.
Upvotes: -1
Reputation: 11571
If you want to add views to LinearLayout in upward direction(i.e. from bottom to up) use
android:gravity="bottom"
property in the xml of LinearLayout and then add views in the layout. Hope this will solve your problem.
Upvotes: 1