问题
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.
回答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.
回答2:
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.
回答3:
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();
来源:https://stackoverflow.com/questions/14911356/titanium-index-html