1
我正在使用线性渐变水平。我想使用更多的渐变颜色而不是结束渐变颜色。目前,两种颜色的比例相等,即在中心相遇。我怎样才能获得比另一种更多的颜色?我也知道setBackgroundGradientRelativeX等方法只适用于径向渐变而不是线性渐变。此外,我有很多简单的渐变设计,所以我不想在任何地方使用图像。这会很麻烦。线性渐变x比例codenameone
categoryTitle.setUIID("partyCategoryTitle");
categoryTitle.getAllStyles().setBackgroundGradientStartColor(0x73a0ff);
categoryTitle.getAllStyles().setBgImage(null);
categoryTitle.getAllStyles().setBackgroundGradientEndColor(0xffffff);
categoryTitle.getAllStyles().setBackgroundGradientRelativeX(1);
categoryTitle.getAllStyles().setBackgroundGradientRelativeY(10);
categoryTitle.getAllStyles().setBackgroundType(Style.BACKGROUND_GRADIENT_LINEAR_HORIZONTAL);