0

Here I add one Relative Layout and that layout one imageView and one ImageButton but i want that imageview is align parentRight align parent bottom.

enter image description here

M.A.K. Ripon
  • 2,070
  • 3
  • 29
  • 47
  • 1
    You can refer this link.... http://stackoverflow.com/questions/4638832/how-to-programmatically-set-the-layout-align-parent-right-attribute-of-a-button – Vijay Nov 04 '16 at 10:32

1 Answers1

2

Try to add this

    android:layout_alignParentRight="true"
    android:layout_alignParentBottom="true"

This is the code

    RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
    TextView textView = new TextView(this);
    textView.setLayoutParams(layoutParams);
Ishan Fernando
  • 2,758
  • 1
  • 31
  • 38