[Android] 代码中动态设置shape

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);

猜你喜欢

转载自www.cnblogs.com/fphuang/p/9061818.html
今日推荐