更改Titanium中右侧导航按钮的backgroundImage - iPhone

时间:2015-06-03 04:30:39

标签: iphone titanium

我正在使用钛合金开发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

由于

1 个答案:

答案 0 :(得分:0)

尝试使用image属性。