0

我刚刚安装了钛和 android sdk 进行开发。在我的项目中,我有一个 index.html,但它没有加载,当我进行构建时,它一直在加载一个“欢迎使用钛”的 html 页面,对于我的生活,我无法找到任何地方来查看它的加载位置从。

我到底如何将我的index.html 设置为应用程序首次加载时加载的那个?我试过添加

index2.html(index2 作为测试),但即使我创建了一个新的空白项目,它仍然会加载这个对钛 URL 的欢迎。

4

3 回答 3

1

Sounds like you created a default alloy project, all the app/controllers/index.xml file does is load another controller, probably called FirstView or something like that. Look through your views directory inside the app directory for another .xml file.

The structure of Alloy is that the index.xml file is loaded first no matter what, so it is not even recognizing your index2.xml. I would highly recommend you go through the Alloy Quick Start to get the general concepts first.

于 2013-02-16T16:56:00.587 回答
0

我认为您正在使用钛合金。

如果是这样,您的文件应该是 index.xml 而不是 index.html

index.xml 包含作为节点的子节点。

对于允许项目,您可以找到 index.xml 文件,对于同一个文件,文件夹 app/controller/index.js 中有一个控制器文件。

在 index.js 文件中必须有以下行

index.open()

此行将在您的应用程序中打开 index.xml 文件。

注意:如果您在 xml 中为窗口节点提供了 id 属性,那么您应该使用 $..open()。这应该可以正常工作。

于 2015-08-01T06:13:05.767 回答
-1

它应该是index.xml,body应该是这样的:

<Alloy>
    <Window id="xyz">
    </Window>
</Alloy>

然后应该有一个index.js文件,你必须通过 id 调用这个 xml 文件:

$.xyz.open();
于 2016-01-26T10:07:36.493 回答