3
我想以编程方式做相对布局,并设置android:layout_widht = 60 android:layout_height = 60.当我以编程方式进行填充所有屏幕?我怎样才能做到这一点?相对布局宽度/高度不能以编程方式工作?
我的代码:`
RelativeLayout relativeLayout=new RelativeLayout(getContext());
RelativeLayout.LayoutParams rel_btn = new RelativeLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
rel_btn.height = 60;
rel_btn.width = 60;
relativeLayout.setLayoutParams(rel_btn);
this.setBackgroundResource(com.example.R.drawable.line);`
屏幕: