DomeWTF
DomeWTF

Reputation: 2420

Android add textview above other textviews

I developed an app that dynamically creates textviews, and the desired result would be:

textview1
textview2
textview3

(then when the user creates a new textview)

textview4
textview1
textview2
textview3

but as of now, textview4 goes under textview3

the textviews are under a linearlayout.

How can I achieve the desired result?

Thank you.

Upvotes: 0

Views: 237

Answers (1)

Broak
Broak

Reputation: 4187

You need to use:

addView (View child, int index)

Index being the position in the view (0 if you want to have it at the top)

Upvotes: 1

Related Questions