2012-11-26 94 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 
} 

}