android 代码实现圆角

mac2025-08-28  10

GradientDrawable drawable=new GradientDrawable(); drawable.setShape(GradientDrawable.RECTANGLE); drawable.setGradientType(GradientDrawable.RECTANGLE); drawable.setCornerRadius(60); drawable.setColor(getResources().getColor(android.R.color.darker_gray)); findViewById(R.id.button).setBackground(drawable);
最新回复(0)