TextView textView = new TextView(this);
GradientDrawable drawable = new GradientDrawable();
drawable.setCornerRadius(5);
drawable.setStroke(1, Color.parseColor("#cccccc"));
drawable.setColor(Color.parseColor("#eeeeee"));
textView.setBackgroundDrawable(drawable);

 

相关文章: