0

我是 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.?`**

      }
  }
}

在此选项卡中,我想在单击选项卡图标时执行推送屏幕功能。谁能帮我完成这两个功能?

谢谢。

4

2 回答 2

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 文件:,

于 2013-02-11T07:51:51.550 回答
0

您必须在每个选项卡内声明一个 NavigationPane,然后将其推入:

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

}

于 2012-11-26T10:08:26.510 回答