gpt4 book ai didi

javascript - 如何将工具栏按钮放置在标题标签的右侧?

转载 作者:行者123 更新时间:2023-12-03 12:34:34 25 4
gpt4 key购买 nike

我将 dojox.mobile.Heading 添加到 dojox.mobile.ScrollableView 中。这很好用,而且我的标题上有一个后退按钮也可以工作。我试图在标题标签的右侧添加一个工具栏按钮,但它显示在标签的左侧,后退按钮之后:

    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");

enter image description here

最佳答案

尝试使用按钮的 domNode 来使用“dojo/dom-style”,如下所示。

require(["dojo/dom-style"], function(domStyle){
domStyle.set(button.domNode, {float:"right"});
});

我认为 placeAt(last) 将其放在小部件的末尾。

button.placeAt(heading2,"last");

希望有帮助。

关于javascript - 如何将工具栏按钮放置在标题标签的右侧?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23789702/

25 4 0