0

I want to use this code to change the alignment of my textView in the layout programmatically.

RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)textView1.getLayoutParams();
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
textView1.setLayoutParams(params);

But When I try it RelativeLayout doesn't have ALIGN_PARENT_RIGHT or generaly Align_... what should I do?

brasofilo
  • 25,496
  • 15
  • 91
  • 179
user3243726
  • 11
  • 1
  • 3

1 Answers1

0

I used:

params.AddRule (LayoutRules.AlignRight);

Instead of :

params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);

It works now...

user3243726
  • 11
  • 1
  • 3