GradientDrawable with OVAL shape not working inside programatically added Text View
问题 I have programmatically added Text View and Button . Code final TextView test = new TextView(getApplicationContext()); test.setText(String.valueOf(counterQuantity)); test.setTextColor(getResources().getColor(R.color.black)); test.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 10); GradientDrawable border = new GradientDrawable(); border.setShape(GradientDrawable.OVAL); border.setStroke(1, getResources().getColor(R.color.black)); border.setCornerRadius(2); border.setColor(getResources().getColor(R