我正在尝试将 PaintDrawable 设置为视图的背景,以便动态更改颜色并保持边框,但是当我编写时:
vi.setBackground(pd);`
我收到一个错误:NoSuchMethodError 这是我的代码:
PaintDrawable pd = new PaintDrawable(color);
pd.setCornerRadius(4);
pd.setPadding(1, 1, 1, 1);
vi.setBackground(pd)
DyL.addView(vi);