public class DrawableUtils
extends java.lang.Object
| 构造器和说明 |
|---|
DrawableUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static android.graphics.drawable.Drawable |
getBackgroundDrawable(float topLeft,
float topRight,
float bottomRight,
float bottomLeft,
int color)
动态生成一个带有圆角的背景
|
static android.graphics.drawable.Drawable |
getBackgroundGradientDrawable(float topLeft,
float topRight,
float bottomRight,
float bottomLeft,
java.lang.String colors)
动态生成一个带有渐变色圆角的背景
|
public static android.graphics.drawable.Drawable getBackgroundDrawable(float topLeft,
float topRight,
float bottomRight,
float bottomLeft,
int color)
topLeft - 左上角半径topRight - 右上角半径bottomRight - 右下角半径bottomLeft - 左下角半径color - 背景色public static android.graphics.drawable.Drawable getBackgroundGradientDrawable(float topLeft,
float topRight,
float bottomRight,
float bottomLeft,
@NonNull
java.lang.String colors)
topLeft - 左上角半径topRight - 右上角半径bottomRight - 右下角半径bottomLeft - 左下角半径colors - 渐变背景色