kiran
kiran

Reputation: 3264

how to i add views to linear layout in upward direction?

I am using Linear Layout to display image view and text view.

I am getting the response from server by using XML parsing.

When i am getting the new response from server the second image view and related text will be displayed in the bottom of the new Layout and so on.

but i want to display the image with related text in the above of the previous Layout.

if any one see this question, please help me.

Thanks in advance.

Upvotes: 1

Views: 110

Answers (1)

Narasimha
Narasimha

Reputation: 3766

You can add it programmatically with:

LinearLayout layout = findViewById(R.id.layout); layout .addView(newView, index); You just have to add always with index = 0

Upvotes: 1

Related Questions