Titanium index.html

自闭症网瘾萝莉.ら 提交于 2020-01-26 04:08:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!