有什么方法可以在 Cascades 或/和 C++ 中绘制简单的线性渐变?我找到了一个使用 QtQuick 库(https://developer.blackberry.com/cascades/reference/qmlreusablecomponents.html)的示例,但它不起作用。Momentics 甚至无法识别此库的导入
问问题
550 次
1 回答
2
Unfortunately gradients are not possible to do that way in Cascades.
I would recommend using an gradient image and ImagePaintDefinition. For example:
Container {
layout: DockLayout {
}
preferredHeight: constants.headerHeight
minHeight: preferredHeight
maxHeight: preferredHeight
minWidth: constants.screenWidth
background: back.imagePaint
attachedObjects: [
Constants {
id: constants
},
ImagePaintDefinition {
id: back
imageSource: "asset:///images/header_solid.png"
repeatPattern: RepeatPattern.X
}
]
}
于 2013-03-31T16:36:48.300 回答