简体   繁体   English

开胃菜。 创建特定于平台的视图

[英]Appcelerator. Creating platform-specific view

I'm learning how to create a Titanium app with the help of the lessons. 我正在学习如何在课程的帮助下创建Titanium应用程序。 Here are the steps given to create the specific view: 以下是创建特定视图的步骤:

To create the iOS-specific view with a NavigationController: 要使用NavigationController创建特定于iOS的视图:

  • In Project Explorer, create a new folder named ios in the app/views folder. 在Project Explorer中,在app / views文件夹中创建一个名为ios的新文件夹。

  • Create a new file named index.xml in the new folder. 在新文件夹中创建一个名为index.xml的新文件。

But when I do those steps I get a message the a view with such name already exists not allowing me to save it. 但是,当我执行这些步骤时,我收到一条消息,即已存在具有该名称的视图,不允许我保存它。 But this was somehow achieved by the author of the lesson. 但这是本课程的作者以某种方式实现的。 I would be grateful if someone could tell me how to do it. 如果有人可以告诉我该怎么做,我将不胜感激。 https://docs.appcelerator.com/platform/latest/#!/guide/Creating_Your_First_Titanium_App https://docs.appcelerator.com/platform/latest/#!/guide/Creating_Your_First_Titanium_App

Create new file into app/views/ios folder. 在app / views / ios文件夹中创建新文件。 I followed the steps of the tutorial and it works perfectly. 我按照本教程的步骤操作,效果很好。 在此处输入图片说明 带有自定义索引的iOS项目

  • First create a new project from Studio. 首先从Studio创建一个新项目。
  • Studio will automatically create the necessary files with a Label and a click event to it. Studio会自动创建带有标签和单击事件的必要文件。
  • Finally all you need to run your app is to select iOS simulator and hit Run button (in green colour arrow). 最后,运行您的应用程序所需要做的就是选择iOS模拟器,然后点击“运行”按钮(绿色箭头)。
  • Now if you are a pure beginner to Titanium, then I would advise you to go through with simple steps and one step at a time to learn it more effectively. 现在,如果您是Titanium的纯粹初学者,那么我建议您以简单的步骤一次完成一个步骤,以更有效地学习它。
  • According to @Jagu's answer, he has created a different folder for iOS and there are two index.xml files, it means that if you run your app on iOS then app->views->ios->index.xml file will run, and if you run the app on other platforms then app->views->index.xml file will be run. 根据@Jagu的回答,他为iOS创建了一个不同的文件夹,并且有两个index.xml文件,这意味着,如果您在iOS上运行应用程序,则app-> views-> ios-> index.xml文件将运行,如果您在其他平台上运行该应用程序,则将运行app-> views-> index.xml文件。
  • You will gradually learn these platform specific techniques, but first try to get good hands on very basic things and always refer Titanium Documentation . 您将逐渐学习这些特定于平台的技术,但是首先尝试获得非常基础的知识,并始终参考Titanium Documentation Some documentations could be older, so always rely on whatever Titanium Studio setup things initially and try to refer more resources over internet. 有些文档可能会比较老,所以一开始总是要依赖任何Titanium Studio设置,然后尝试通过Internet引用更多资源。

Good Luck!!! 祝好运!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM