我开始使用 Cascades 为我闪亮的新 BB10 Dev Alpha B 进行开发(怀疑我可以在 WebWorks 上实现一个功能齐全的 Mp3 播放器,尽管我真的很想这样做)并且我一直在尝试让 QML 和 C++ 发挥作用很好,如https://developer.blackberry.com/cascades/documentation/dev/integrating_cpp_qml/index.html中所述,但无论我放在哪里
property alias artistText: artist.Text
QNX Momentics IDE 抱怨它位于无效位置。我还没有找到任何关于所述属性应该在哪里的指导方针,所以我决定在这里问。
import bb.cascades 1.0
Page {
actionBarVisibility: ChromeVisibility.Visible
Container {
layout: DockLayout {
}
Button {
text: "Random"
verticalAlignment: VerticalAlignment.Top
}
Button {
text: "Repeat"
horizontalAlignment: HorizontalAlignment.Right
}
Container {
verticalAlignment: VerticalAlignment.Center
ImageView {
preferredWidth: 615.0
preferredHeight: 615.0
minWidth: 615.0
minHeight: 615.0
maxWidth: 615.0
maxHeight: 615.0
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
imageSource: "asset:///test.jpg"
}
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Bottom
topMargin: 60.0
Label {
id: artist
text: "Artist"
horizontalAlignment: HorizontalAlignment.Center
}
Label {
id: song
text: "Track"
horizontalAlignment: HorizontalAlignment.Center
}
Label {
id: album
text: "Album"
horizontalAlignment: HorizontalAlignment.Center
}
Container {
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
Button {
text: "Previous"
}
Button {
text: "Pause"
}
Button {
text: "Next"
}
}
Slider {
verticalAlignment: VerticalAlignment.Bottom
horizontalAlignment: HorizontalAlignment.Center
fromValue: 0
toValue: 100
}
}
}
}
}