android.graphics.drawable.GradientDrawable gd = new android.graphics.drawable.GradientDrawable();
gd.setColor(Color.parseColor("#FFFFFF"));
gd.setCornerRadius(40);
linear1.setBackground(gd);
use with MoreBlock:
android.graphics.drawable.GradientDrawable gd = new android.graphics.drawable.GradientDrawable();
gd.setColor(Color.parseColor(_color));
gd.setCornerRadius((int)_numb);
_view.setBackground(gd);
// _color your color string
// _numb Radious Number
// _view to view
Note:
gd.setCornerRadii(new float[] { 10, 10, 12, 12, 14, 14, 20, 20 }); //LeftTop, //RightTop, //RightBottom, //LeftBottom,
gd.setCornerRadius(40); //For All Radius
Komentar