Titanium index.html

2019-08-30 18:18发布

ive just installed titanium and the android sdk for development. In my project i have an index.html but its not loading that when i do a build, it keeps loading a 'welcome to titanium' html page which for the life of me i just can't find anywhere to see where its being loaded from.

How the heck do i set my index.html to be the one that is loaded when the app first loads? I have tried adding

index2.html (index2 as a test) but its still loading this welcome to titanium url even when i make a new blank project.

3条回答
放荡不羁爱自由
2楼-- · 2019-08-30 18:54

I think you are working with titanium alloy.

if so, your file should be index.xml and not index.html

index.xml contains as a child node of node.

for allow project you can find index.xml file and for the same file there is a controller file in folder app/controller/index.js.

in index.js file there must b a following line

index.open()

this line will open the index.xml file in your app.

Note : if you have given id attribute to window node in xml than you should use $..open(). this should work fine.

查看更多
Evening l夕情丶
3楼-- · 2019-08-30 19:04

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.

查看更多
叼着烟拽天下
4楼-- · 2019-08-30 19:06

It should be index.xml and body should be like this:

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

Then there should be index.js file where you have to call this xml file by id:

$.xyz.open();
查看更多
登录 后发表回答