【发布时间】:2020-07-15 20:46:40
【问题描述】:
大家好,我正在尝试使 ActionBar 与上图相同(使用此“wave”),其中红色可以在运行时更改。我尝试使用 GradientDrawable(代码如下),但渐变效果并不酷,也不是我需要的。
GradientDrawable gd = new GradientDrawable(
GradientDrawable.Orientation.LEFT_RIGHT,
new int[] {cor, Color.WHITE});
gd.setCornerRadius(0f);
actionBar.setBackgroundDrawable(gd);
有什么想法吗?
【问题讨论】: