I'm having trouble finding exactly the syntax I need to use to set the paramters on child views of a relative layout. I have a root relative layout that I want to set 2 child textviews next to each other like this
---------- --------- | Second | | First | ---------- ---------
So I have
public class RL extends RelativeLayout{
public RL(context){
TextView first = new TextView(this);
TextView second = new TextView(this);
first.setText('First');
first.setId(1);
second.setText('Second');
second.setId(2);
addView(first, new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT,
LayoutParams.ALLIGN_PARENT_RIGHT ???);
addView(first, new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT,
LayoutParams.ALLIGN_RIGHT_OF(first.getId()) ???);
}
}
How do I set the relative alignments?