[英]How to place a toolbar button to the right of the heading label?
I have a dojox.mobile.Heading added to a dojox.mobile.ScrollableView. 我有一个dojox.mobile.Heading添加到了dojox.mobile.ScrollableView中。 This works great, and I have a back button on the heading working as well. 这很好用,我的标题上也有一个后退按钮。 I am trying to add a toolbar button to the right of the heading label, but it is displayed on the left of the label, after the back button: 我试图在标题标签的右侧添加一个工具栏按钮,但在后退按钮之后,它显示在标签的左侧:
var heading2 = new dojox.mobile.Heading({
id: "appListHeader",
label: "?", // placeholder, replaced when device is selected.
back: "Devices",
moveTo: "deviceList"
});
var button = new dojox.mobile.ToolBarButton ({
moveTo: "settingsView",
icon: "../images/settings.png"
});
button.placeAt(heading2,"last");
Try to use "dojo/dom-style" as shown below by using the domNode of the button. 尝试通过使用按钮的domNode来使用“ dojo / dom-style”,如下所示。
require(["dojo/dom-style"], function(domStyle){
domStyle.set(button.domNode, {float:"right"});
});
placeAt(last) puts it at the end of the widget, I assume. 我假设placeAt(last)将其放在小部件的末尾。
button.placeAt(heading2,"last");
Hope it helps. 希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.