代码:
MGerative 的属性
android.graphics.drawable.GradientDrawable properties = new android.graphics.drawable.GradientDrawable();
彩色描边阴影圆形
properties.setColor(Color.parseColor(_color));
properties.setCornerRadii(new float[]{(int) _r1,(int) _r1,(int) _r2,(int) _r2,(int) _r4,(int) _r4,(int) _r3,(int) _r3});
properties.setStroke((int) _stroke, Color.parseColor(_colour));
_view.setElevation((float) _shadow);
_view.setBackground(properties);
尺码
LinearLayout.LayoutParams size = new LinearLayout.LayoutParams((int)(getResources().getDisplayMetrics().density*_width), (int)(getResources().getDisplayMetrics().density*_height));
_view.setLayoutParams(size);
完成!