dojo tabbar programatically created but not fixed at the right position

半世苍凉 提交于 2019-12-13 04:58:43

问题


i created a dojo tabbar programmatically and set the fixed:"bottom" attribute but the tabbar is created below the existing document and not fixed at the bottom of the window. After i have done a performeTransition to another view its fixed at bottom correctly.

i did it like this:

        function createTabbar() {   
        var tabBar = new dojox.mobile.TabBar({id:"tabContainer", barType : "tabBar", fixed: "bottom"}).placeAt(dijit.byId("mobileView")); 
        var tabBarButtonNodes = new dojox.mobile.TabBarButton({label:"Knoten", id:"tabBarButtonNodes", moveTo:"divNodes0", icon1 : "img/nodes_60.png", icon2 : "img/nodes_60.png"}).placeAt(tabBar.domNode); 
        var tabBarButtonInfo = new dojox.mobile.TabBarButton({label:"Info", id:"tabBarButtonInfo", moveTo:"divInfo", icon1 : "img/info_60.png", icon2 : "img/info_60.png"}).placeAt(tabBar.domNode); 
        var tabBarButtonLogin = new dojox.mobile.TabBarButton({label:"Login", id:"tabBarButtonLogin", moveTo:"divLogin", icon1 : "img/login_60.png", icon2 : "img/login_60.png"}).placeAt(tabBar.domNode); 
        var teest = dijit.byId("divInfo");
        tabBar.resize();
        }

do i have to resize anything else?


回答1:


As documented, the "fixed" flag matters for dojox/mobile/ScrollableView only. There are two cases: a header/footer at the level of the entire application, and locally at the level of a given ScrollableView. You can find details here:

  • local view header/footer: https://dojotoolkit.org/reference-guide/1.9/dojox/mobile/ScrollableView.html#view-header-footer-bar-example
  • global application header/footer: https://dojotoolkit.org/reference-guide/1.9/dojox/mobile/ScrollableView.html#application-header-footer-bar-example

For the local case, you can add the fixed bar using the method ScrollableView.addFixedBar. For an example, see dojox/mobile/tests/test_dynamic-ScrollableView-vh-vf.html.

Hope this helps, Adrian



来源:https://stackoverflow.com/questions/16587003/dojo-tabbar-programatically-created-but-not-fixed-at-the-right-position

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!