[java] view plain copy
- RelativeLayout relativeLayout= new RelativeLayout(this);
[java] view plain copy
- RelativeLayout.LayoutParams rlp=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
- rlp.addRule(RelativeLayout.CENTER_IN_PARENT);//addRule参数对应RelativeLayout XML布局的属性
- relativeLayout.addView(progressBar,rlp);
原文地址:https://www.cnblogs.com/Free-Thinker/p/8919733.html
时间: 2024-11-08 18:13:43