1. 程式人生 > >動態設定shape 背景顏色 圓角

動態設定shape 背景顏色 圓角

GradientDrawable colorDrawable = new GradientDrawable();
colorDrawable.setColor(Color.parseColor(item.getBidTags().get(0).getTagColor()));
colorDrawable.setCornerRadius(mContext.getResources().getDimension(R.dimen.x5));
textView.setGravity(Gravity.CENTER);
textView.setBackgroundDrawable(colorDrawable);