Search code examples
androidandroid-linearlayout

How to add views to LinearLayout, but from bottom upwards?


It is possible to add views to LinearLayout one after another in upward direction?


Solution

  • 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?