我正在尝试以编程方式制作具有不同渐变的按钮。我使用ShapeDrawable,它就像一个魅力。RoundRectShapers=newRoundRectShape(newfloat[]{12f,12f,12f,12f,12f,12f,12f,12f},null,null);ShapeDrawablesd=newShapeDrawable(rs);ShapeDrawable.ShaderFactorysf=newShapeDrawable.ShaderFactory(){@OverridepublicShaderresize(intwidth,intheight){LinearGradi