可绘制设计 3 个具有相同颜色的角,否则 1 个具有其他颜色的角



颜色代码 : e32b0f, d03559, 我想设计它的背景可绘制的请帮助我

    Try,
    int colors[] = { 0xff255779, 0xfcc6c0cd };
                GradientDrawable gradientDrawable = new GradientDrawable(
                        GradientDrawable.Orientation.TOP_BOTTOM, colors);
                view.setBackgroundDrawable(gradientDrawable);
1. choose color and add color hex code in colors array.
2. GradientDrawable using and set orientation properties.[ex. GradientDrawable.Orientation.TOP_BOTTOM]
3. set view background [ex. Linearlayout.setBackgroundDrawable(gradientDrawable);]

相关内容

最新更新