I am trying to make programatically a PaintDrawable background for a TextView so it can have rounded bottom corners. Here is the code:
View head = findViewById(R.id.ibTitle);
PaintDrawable bkgrnd = new PaintDrawable(R.color.Red);
((PaintDrawable) bkgrnd).setCornerRadii(new float [] {0,0, 0,0, 6,6, 6,6});
head.setBackgroundDrawable((PaintDrawable) bkgrnd);
ibTitle is a TextView.
The problem is that there is no indication of any change to its background, color or corners.
I must be missing something simple. Please help.
You can make round corners in xml also and then only set the background from resource
like setbackground from resource R.drawable.mydrawable
where mygdawable can be something like: