【发布时间】:2013-01-14 16:48:34
【问题描述】:
Alloy 的 Require src="menu" 出现问题。当我想通过 Require XML-Tag 导入菜单时出现编译错误。
我的 Menu.xml:
<Alloy>
<Menu id="menu">
<MenuItem onClick="doSomething" title="Item 1">
<MenuItem onClick="doSomething" title="Item 2">
<MenuItem onClick="doSomething" title="Item 3">
<MenuItem onClick="doSomething" title="Item 4">
</Menu>
</Alloy>
我的 index.xml:
<Alloy>
<Window id="index">
....a tableview or something...
<Require src="menu">
</Window>
</Alloy>
现在当我编译时,我得到:
[ERROR] Alloy compile failed
[ERROR] Application Installer abnormal process termination. Process exit value was 1
还有上面几行:
TypeError: Cannot read property 'nodeName' of undefined
然而,
如果我将菜单直接放入 index.xml 中,一切都可以正常编译...
【问题讨论】:
-
假设
Menu.xml在同一目录下,将<Require src="menu">更改为<Require src="Menu"/> -
神圣的仓鼠!嗯。这没有帮助:(我实际上把所有东西都改成了小写,因为我的 menu.xml 也是小写的。只有
-
nodeName的来源在哪里?
标签: titanium appcelerator require appcelerator-mobile android-menu