【发布时间】:2015-06-03 04:30:39
【问题描述】:
我正在使用钛合金开发 iPhone 应用程序。
我的问题是我想更改 rightNav 按钮的 backgroundImage。
我使用 rightNav 按钮作为过滤器按钮。我的过滤器按钮放置在一个窗口中,该窗口也有一个表格。单击过滤器按钮后,将打开一个新窗口,用户可以在其中进行一些选择。做出选择后,上一页的表格会根据所做的选择刷新,我想更改 rightNav 按钮的 backgroundImage 以显示已应用了一些选择。但我无法这样做。
我的代码:
if ((screenType === "parentWindow") {
$.rightNav.visible = true;
$.rightNav.backgroundImage = "/images/buttons/filterOff.png";
} else if ((screenType === "childWindow")) {
$.rightNav.visible = true;
$.rightNav.backgroundImage = "/images/buttons/filterOn.png";
}
rightNav按钮的backgroundImage是第一次设置的,之后就没有改变了。我尝试将其设为 null,然后再次设置,但它不起作用。
请帮忙。
其他细节: Titanium 命令行界面,CLI 版本 4.0.0,Titanium SDK 版本 4.0.0.RC,Mac OS X 10.10
谢谢
【问题讨论】: