I have a LinearLayout with two views
<LinearLayout>
<TextView />
<Textview />
</LinearLayout>
Through my program, I want to add a third TextView
between these two existing TextViews
'.
It was easy to do with a RelativeLayout
with layout_below
parameter. How do I do this for LinearLayout
?
LinearLayout.addView(View v, int index)
The docs are a good place to start with this sort of thing.
Just pass an index to where you want it placed (i.e. 2nd position would be index 1).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With