2016-03-05 45 views
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); 

回答

0

由于目前的渐变don't really work on Android我会避免它。

我不能强调在当前实现中当梯度工作时梯度性能有多糟。将功能添加到目前无法正常工作的内容并不是优先事项。