For example
<LinearLayout>
<TextView />
<ImageView />
<Button />
<RelativeLayout />
<ImageView/>
</LinearLayout>
Now how to add dynamicly Layout after Button?
If i get first (root) Layout and i addView() adds in the end.
For example
<LinearLayout>
<TextView />
<ImageView />
<Button />
<RelativeLayout />
<ImageView/>
</LinearLayout>
Now how to add dynamicly Layout after Button?
If i get first (root) Layout and i addView() adds in the end.
You can do that using RelativeLayout as parent layout.
Xml:
<RelativeLayout>
<TextView />
<ImageView />
<Button />
<RelativeLayout />
<ImageView/>
</RelativeLayout>
Java:
RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
param.addRule(RelativeLayout.BELOW, R.id.existing_layout);
newView.setLayoutParams(param);
Hope this helps.