获取高度和宽度
RelativeLayout r = (RelativeLayout ) findViewById(...);
r.getLayoutParams().height
r.getLayoutParams().width
设置高度和宽度
RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams(Width,Height);
param.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, 1);
LayoutId.setLayoutParams(param);
设置一组
ViewGroup.MarginLayoutParams params = new ViewGroup.MarginLayoutParams( Width,Height);
param1.addRule(RelativeLayout.CENTER_VERTICAL, 1);
btn1.setLayoutParams(param1);
RelativeLayout.LayoutParams param2 = new RelativeLayout.LayoutParams(params);
param2.addRule(RelativeLayout.CENTER_VERTICAL, 1);
param2.addRule(RelativeLayout.RIGHT_OF, R.id.function_news);
btn2.setLayoutParams(param2);
............................................