Reputation: 1293
this is standard addView in a LinearLayout.
table.addView(child);
but i need to add the view in my layout with this way
Please it is possible to do it??!
Upvotes: 2
Views: 2881
Reputation:
Ascending Order:
parentView.addView(child, 0);
Descending Order:
parentView.addView(child, parentView.getChildCount() - 1);
Upvotes: 4
Reputation: 18725
I don't think it is possible to add items to a Vertically oriented LinearLayout, starting from the bottom to the top.
You could use a RelativeLayout, also vertically oriented, then place your first item with gravity=bottom, then place your next items above that item (relatively).
Upvotes: 0
Reputation: 4258
Check this out: addView(View view, int position)
Basically you use this method with 0 for "position" and it will insert the view at the front.
Upvotes: 1