我动态的创建了一个Relative Layout:
RelativeLayout layout = new RelativeLayout( this );
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT);
现在我想在Relative Layout上面添加两个按钮,但是这两个按钮都显示在Relative Layout的左边,还重叠在一起。
buttonContainer.addView(btn1);
buttonContainer.addView(btn2);
现在我想知道如何动态的设置按钮的属性android:layout_alignParentRight="true"
或者android:layout_toLeftOf="@id/btn"
就像在xml中一样?