从控制器打开另一个窗口

时间:2013-07-02 09:42:57

标签: titanium titanium-mobile

我的钛合金项目中有按钮命名设置。我想要的是,点击/点击按钮打开设置窗口。所以我使用了以下代码

var settingsWindow = Alloy.createController('settings').getView();
settingsWindow.open();

在我的settings.xml文件中,我的视图中包含以下代码

<Alloy>
    <window id="settings">
        <label onClick="settingsAlert">Settings Page</label>
    </window>
</Alloy>

我的问题是,我在我的模拟器上说

时遇到了这个运行时错误

未捕获的TypeError:对象#没有方法'createwindow'

1 个答案:

答案 0 :(得分:0)

<Alloy>
    <window id="settings">
        <label onClick="settingsAlert">Settings Page</label>
    </window>
</Alloy>

应该是

<Alloy>
    <Window id="settings">
        <Label onClick="settingsAlert">Settings Page</Label>
    </Window>
</Alloy>

Alloy区分大小写,window应为Windowlabel应为Label