Is there any way to draw a simple linear gradient in Cascades or/and C++? I've found an example using QtQuick library (https://developer.blackberry.com/cascades/reference/qmlreusablecomponents.html), but it doesn't work. Even the import of this library isn't recognized by Momentics
Asked
Active
Viewed 551 times
1
-
It does appear to be a valid question. Wondering why no one has answered it. For me it appears likes the documentation is wrong – Arul Kumaran Mar 31 '13 at 00:26
1 Answers
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
}
]
}

Ergin Babani
- 346
- 1
- 2