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.
Asked
Active
Viewed 2,402 times
0
-
1You 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 Answers
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