问题描述
我以编程方式创建了一个dojo标签栏,并设置了固定的底部属性,但在现有文档下方创建了标签栏,而不是固定在窗口的底部。在我完成了另一个视图之后,将其固定在底部正确。我这样做了:
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();
}
我必须调整大小吗?
如下所述,固定标志仅适用于dojox / mobile / ScrollableView。有两种情况:在整个应用程序级别的页眉/页脚,以及本地在给定的ScrollableView的级别。您可以在这里找到详细信息:
- local view header / footer:
- 全局应用程序页眉/页脚:
对于本地情况,您可以使用ScrollableView.addFixedBar方法添加固定栏。例如,请参阅dojox / mobile / tests / test_dynamic-ScrollableView-vh-vf.html。
希望这有帮助,
Adrian
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?
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
这篇关于dojo标签栏以编程方式创建但未固定在正确的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!