2012-11-26 95 views
0

我是黑莓10开发的新手。我已经创建了一个按钮,但我无法从当前屏幕到下一个屏幕执行推屏功能。这里是我使用的代码:黑莓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.?`** 

     } 
    } 
} 

一个标签在此标签我想点击选项卡的图标时执行推屏功能。任何人都可以帮助我完成这两个功能吗?

谢谢。

回答

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文件
0

你要申报每个标签内NavigationPane,并推动它里面:

Tab { 
title: "Puppies" 
onTriggered: label.text = "kittens" 
NavigationPane { 
    id: navigationPane 
} 

}