qooxdoo将导航页面添加到抽屉

时间:2014-04-12 20:48:16

标签: qooxdoo

我想在抽屉里添加一个nagivation页面。

或者,我想使用manager.addMaster(my_navigation_page)功能,但主页面有后退按钮,主内容位于右侧。

这有可能吗?

这是我到目前为止(抽屉是空的,它不显示NavigationPage page2)

qx.Class.define("drawer00.Application",

{
  extend : qx.application.Mobile,



  /*
  *****************************************************************************
     MEMBERS
  *****************************************************************************
  */

  members :
  {
    /**
     * This method contains the initial application code and gets called 
     * during startup of the application
     */
    main : function()
    {
      // Call super class
      this.base(arguments);

      // Enable logging in debug variant
      if (qx.core.Environment.get("qx.debug"))
      {
        // support native logging capabilities, e.g. Firebug for Firefox
        qx.log.appender.Native;
        // support additional cross-browser console. Press F7 to toggle visibility
        qx.log.appender.Console;
      }

      /*
      -------------------------------------------------------------------------
        Below is your actual application code...
        Remove or edit the following code to create your application.
      -------------------------------------------------------------------------
      */

      var page1 = new qx.ui.mobile.page.NavigationPage();
      var drawer = new qx.ui.mobile.container.Drawer(page1, new qx.ui.mobile.layout.VBox());
    var navigation = new qx.ui.mobile.container.Navigation();

      page1.setTitle("Page 1");
      page1.addListener("initialize", function()
      {
      drawer.show();
      },this);

      var page2 = new qx.ui.mobile.page.NavigationPage();
      page2.setTitle("Page 2");
      page2.setShowBackButton(true);
      page2.setBackButtonText("Back");
      page2.addListener("initialize", function()
      {
        var label = new qx.ui.mobile.basic.Label("Content of Page 2");
        page2.getContent().add(label);
      },this);

      page2.addListener("back", function() {
        page1.show({reverse:true});
      }, this);

      // Add the pages to the page manager.
    drawer.add(navigation);
    drawer.add(page2);
      var manager = new qx.ui.mobile.page.Manager(false);
      manager.addDetail([
        page1,
      ]);

      // Page1 will be shown at start
      page1.show();
    page2.show();
    }
  }
});

感谢您的时间和关心。

jenia

1 个答案:

答案 0 :(得分:0)

您可以通过以下方式访问抽屉:

http://demo.qooxdoo.org/current/apiviewer/#qx.ui.mobile.page.Manager~getMasterContainer!method_public

然后使用:

setOrientation("right")