我是Blackberry 10开发的新手。我创建了一个按钮,但是我无法从当前屏幕到下一个屏幕执行推送屏幕功能。这是我正在使用的代码:
onClicked:{
navigationPane.push(firstPage);
}
我还使用
实现了一个标签TabbedPane {
activePane: Page {
Label {
id: label
text: "What do you like more, kittens or puppies?"
}
}
sidebarState: SidebarState.VisibleCompact
onActiveTabChanged: {
}
Tab {
title: "Puppies"
onTriggered: label.text = "kittens"
NavigationPane {
id: navigationPane
//how to call a screen from this,i got stuck with this,can any some send me simple code for pushing a screen.?
}
}
Tab {
title: "Kittens"
onTriggered: label.text = "I love kittens!"
NavigationPane {
id: navigationPane
> **`//how to call a screen from this,i got stuck with this,can any some send me simple code for pushing a screen.?`**
}
}
}
在此选项卡中,我想在单击选项卡图标时执行推屏功能。任何人都可以帮我解决这两个问题吗?
感谢。
答案 0 :(得分:1)
这里是为不同屏幕创建标签的示例,您在主标签中按下列方式转到下一个qml
Tab {
title: "Puppies"
NavigationPane {
id: navigationPane
Sample //this is one qml page as like Sample.qml
{
}
}
}
Tab {
title: "Kittens"
NavigationPane {
id: testpage
Test //this is one qml page as like Test.qml
{
}
}
}
您可以通过设置ID:,
来访问其他qml文件答案 1 :(得分:0)
你必须在每个Tab中声明一个NavigationPane,并在其中推送:
Tab {
title: "Puppies"
onTriggered: label.text = "kittens"
NavigationPane {
id: navigationPane
}
}