android: How to insert a bottom aligned view without layout.xml? -


I want to insert dynamically using addView method.

  TextView view = New text view (this); View.setText ("foo"); ViewGroup parentView = (ViewGroup) findViewById (R.id.main_layout); ParentView.addView (see);   

How do I align the view inserted below?

Try this you will get the result:

  Relative layout parent Find = (Relative Layout) VViBiID (RID Belowout); TextView textView = new text view (this); TextView.setText ("foo"); RelativeLayout.LayoutParams Parameters = New Relative Layout. LayoutParms (see group layoutpermsMThPARNRT, view groupLateParamusWRAP_CONTENT); Params.addRule (relative layout. ALIGN_PARENT_BOTTOM, textView.getId ()); TextView.setLayoutParams (parameter); Parent.addView (TextView);    

Comments