<span style="font-size:24px;"><span style="white-space:pre"> </span>GradientDrawable drawable=new GradientDrawable(); //设置边框,参数为边框的类型,有矩形,椭圆,还有线等等,自己去试; drawable.setShape(GradientDrawable.RECTANGLE); //设置边框的厚度和颜色 drawable.setStroke(1, Color.BLUE); //边框为矩形的时候,还可以设置边框四个角的幅度 drawable.setCornerRadius(DensityUtils.dip2px(mActivity, 50)); //填充背景颜色 drawable.setColor(Color.GRAY);</span><span style="font-size:24px;"><span style="w