¥È¥Ã¥×   ÊÔ½¸ Åà·ë º¹Ê¬ ¥Ð¥Ã¥¯¥¢¥Ã¥× źÉÕ Ê£À½ ̾Á°Êѹ¹ ¥ê¥í¡¼¥É   ¿·µ¬ °ìÍ÷ ñ¸ì¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS

Titanium Mobile/¥×¥í¥¸¥§¥¯¥È¿·µ¬ºîÀ®

Last-modified: 2018-11-14 (¿å) 15:24:04 (2153d)
Top / Titanium Mobile / ¥×¥í¥¸¥§¥¯¥È¿·µ¬ºîÀ®

Titanium Mobile¤Î¥×¥í¥¸¥§¥¯¥È¤Ï[File] - [New] - [Mobile Project]¤«¤é¹Ô¤¤¤Þ¤¹¤¬¡¢¿÷·Á¤Î¼ïÎब¿¤¤¤Î¤Ç¥á¥â¤Ç¤¹¡£

tiapp.xml¥ª¥¹¥¹¥áÀßÄê

ñ°Ì¤òsystem¤«¤édp¤ËÊѹ¹

    <property name="ti.ui.defaultunit" type="string">dp</property>

Íýͳ¡§¤³¤Á¤é¤ÎÊý¤¬Android¤Ë¤âÂбþ¤µ¤»¤ë¤È¤­¤Ë¥Ü¥¿¥ó¤ÎÂ礭¤µ¤Ê¤É¤¬iPhone¤È¶á¤¯¤Ê¤ê¤Þ¤¹¡£2014ǯ»þÅÀ¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤Çdp¤È¤Ê¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£

³«È¯¥Ó¥ë¥É¤Î»þ¤âAndroid¤Çminify¤¬¤«¤«¤ë¤è¤¦¤ËÀßÄê

¼¡¤Î¹Ô¤òÄɲä·¤Þ¤¹¡£

    <property name="ti.android.compilejs" type="bool">true</property>

Íýͳ¡§JSON¥Ç¡¼¥¿¤ËÊѤÊminify¤¬¤«¤«¤ê¡¢ÉÔ¶ñ¹ç¤Î¸¶°ø¤È¤Ê¤ë¾ì¹ç¤¬¤¢¤ë¤½¤¦¤Ç¤¹¡£ »²¹Í¥Ú¡¼¥¸¡§Titanium¤ÇAndroid¥¢¥×¥ê¤ò¥ê¥ê¡¼¥¹¥Ó¥ë¥É¤·¤¿¤È¤­¤À¤±¾å¼ê¤¯Æ°¤«¤Ê¤¯¤Æµã¤¤¤¿Ïà | ¥ê¥¢½¼ÇúȯÆüµ­

Classic

Default Project

¿÷·Á¤¬¶õ¤Î¥×¥í¥¸¥§¥¯¥È¡£´°Á´¤Ë¶õ¤Ç¤Ê¤¯¡¢app.jsÆâ¤ÇTabGroup¤äWindow¤òºî¤ë¥µ¥ó¥×¥ë¤¬Æþ¤Ã¤Æ¤¤¤Þ¤¹¡£

js¥Õ¥¡¥¤¥ë̾ÆâÍÆ
app.jsTabGroup¤òÀ¸À®¤·¤Æ¡¢¥é¥Ù¥ëÆþ¤ê¤ÎWindow£²¤Ä¤òÄɲä·¤Æopen

Single Window Application

¥·¥ó¥×¥ë¤Ê¥¦¥£¥ó¥É¥¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¡£¥Ê¥Ó¥²¡¼¥·¥ç¥ó¥Ð¡¼¤ÏÉÕ¤¤¤Æ¤ª¤é¤º¡¢£±²èÌ̤Ǥ¤¤¤¤Î¤Ç²èÌ̤ò¹­¤¯»È¤¤¤¿¤¤¾ì¹ç¤Ë¥ª¥¹¥¹¥á

js¥Õ¥¡¥¤¥ë̾ÆâÍÆ
app.js¥¿¥Ö¥ì¥Ã¥È¡¦iPhone¡¦Android¤ÎȽÄê¤ò¤·¤Æ¡¢¤½¤ì¤¾¤ì¤ÎWindow¤ò³«¤¯
ui/handheld/ApplicationWindow.jsiPhoneÍѤÎWindow¡£¥·¥ó¥×¥ë¤ËFirstView¤òadd¤¹¤ë¡£var firstView = new FirstView(); self.add(firstView);
ui/handheld/android/ApplicationWindow.jsAndroidÍÑ
ui/tablet/ApplicationWindow.js¥¿¥Ö¥ì¥Ã¥ÈÍÑ
ui/common/FirstView.js¥¿¥Ö¥ì¥Ã¥È¡¦iPhone¡¦Android¶¦Ä̤ÎView¡£¥µ¥ó¥×¥ë¤È¤·¤Æ¥¯¥ê¥Ã¥¯²Äǽ¤Ê¥é¥Ù¥ë¤òÇÛÃÖ

Master/Detail Application

¥Æ¡¼¥Ö¥ë¤òɽ¼¨¤·¡¢ÁªÂò¤¹¤ë¤ÈÊÌ¥¦¥£¥ó¥É¥¦¤ò³«¤¯¥µ¥ó¥×¥ë¤Ç¤¹¡£iOS¤Ç¤Ï¥Ê¥Ó¥²¡¼¥·¥ç¥ó¥Ð¡¼¤âɽ¼¨¤µ¤ì¡¢ÊÌ¥¦¥£¥ó¥É¥¦¤Îº¸¾å¤òÁªÂò¤¹¤ë¤È¸µ¤Î¥Æ¡¼¥Ö¥ë¤ËÌá¤ê¤Þ¤¹¡£
¥Ê¥Ó¥²¡¼¥·¥ç¥ó¥Ð¡¼¤òÍøÍѤ¹¤ëÊýË¡¤Ï¤³¤Î¿÷·Á¤Î¤è¤¦¤ËNavigationGroup¤ò»ÈÍѤ¹¤ëÊýË¡¤È¡¢¼¡¤Î¹àÌܤÇÀâÌÀ¤¹¤ëTabGroup¤ò»ÈÍѤ¹¤ëÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£NavigationGroup¤ÏAndroid¤Ë¸ºß¤»¤º¡¢¤³¤ì¤ò»ÈÍѤ¹¤ë¤ÈWindow¤ÎÀ¸À®¤äÀÚ¤êÂؤ¨¤òAndroid¤ÈiOS¤Ç¥³¡¼¥É¤ò½ñ¤­´¹¤¨¤Ê¤¤¤È¤¤¤±¤Þ¤»¤ó¡£ TabGroup¤Ç¤¹¤ÈiOS¤ÈAndroid¤Ç¶¦Ä̤˵­½Ò¤Ç¤­¤ë¤Î¤Ç¡¢¥¿¥Ö¤ò»È¤ï¤Ê¤¤¾ì¹ç¤Ç¤â¡ÖTabbed Application¡×¤ò¿÷·Á¤È¤·¤Æ¥¿¥Ö¤òÈóɽ¼¨¤Ç»ÈÍѤ¹¤ë¤Û¤¦¤¬¥ª¥¹¥¹¥á¤Ç¤¹¡£

js¥Õ¥¡¥¤¥ë̾ÆâÍÆ
app.js¥¿¥Ö¥ì¥Ã¥È¡¦iPhone¡¦Android¤ÎȽÄê¤ò¤·¤Æ¡¢¤½¤ì¤¾¤ì¤ÎWindow¤ò³«¤¯
ui/handheld/ios/ApplicationWindow.jsNavigationGroup¤òadd¤·¤¿iPhoneÍѤÎWindow¡£³¬Áؤξ夫¤é½ç¤Ë¼¡¤Î¤è¤¦¤ËÀßÄê¡£Window->NavigationGroup->MasiterContainerWindow->MasterView¡£¥Þ¥¹¥¿¡¼¤Î¹Ô¤¬ÁªÂò¤µ¤ì¤ë¤ÈnavGroup.open(detailContainerWindow);¤È¤·¤ÆNavigationGroup¤«¤é²¼¤ÎÉôʬ¤òÀÚ¤êÂؤ¨¤ë¡£Ãí°Õ»ö¹à¡§NavigationGroup¤ÏTi.UI.iPhone.createNavigationGroup¤ÇÀ¸À®¤·¡¢iPhone°Í¸¤Î¥³¡¼¥É¤È¤Ê¤ê¤Þ¤¹¡£
ui/handheld/android/ApplicationWindow.jsMasterView¤òadd¤·¤¿AndroidÍѤÎWindow¡£³¬Áؤξ夫¤é½ç¤Ë¼¡¤Î¤è¤¦¤ËÀßÄê¡£Window->MasterView¡£¥Þ¥¹¥¿¡¼¤Î¹Ô¤¬ÁªÂò¤µ¤ì¤ë¤È¿·¤¿¤ËÀ¸À®¤·¤¿DetailContainerWindow->DetailView¤òopen¤·¤ÆWindow¤´¤ÈÀÚ¤êÂؤ¨¡£
ui/handheld/mobileweb/ApplicationWindow.jsMobileWebÍÑ
ui/tablet/ApplicationWindow.js¥¿¥Ö¥ì¥Ã¥ÈÍÑ
ui/common/MasterView.jsTableView¤òÀ¸À®¤·¡¢¹Ô¤òclick¤¹¤ë¤È¼«¿È¤ÎView¤Î¥«¥¹¥¿¥à¥¤¥Ù¥ó¥È¤òȯÀ¸¤µ¤»¤ë¡£
ui/common/DetailView.js¼«¿È¤ÎView¤ËÂФ¹¤ë¥«¥¹¥¿¥à¥¤¥Ù¥ó¥È¤ò´Æ»ë¤·¡¢È¯À¸¤·¤¿¤é¥é¥Ù¥ëÆâÍƤò¹¹¿·¡£

Tabbed Application

¥¿¥ÖÉÕ¤­¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¿÷·Á¡£¥¿¥Ö¤½¤ì¤¾¤ì¤ÇÆÈΩ¤·¤Æ¡¢¥Ê¥Ó¥²¡¼¥·¥ç¥ó¥Ð¡¼¤Ë¤è¤ë²èÌÌÁ«°Ü¤¬¹Ô¤¨¤Þ¤¹¡£

¥Ê¥Ó¥²¡¼¥·¥ç¥ó¥Ð¡¼¤Ë¤è¤ë²èÌÌÁ«°Ü¤À¤±¤òÍøÍѤ¹¤ë¤¿¤á¡¢¥¿¥Ö¤òÈóɽ¼¨¤È¤¹¤ëÊýË¡

  1. ApplicationTabGroup.js¤Çwin2, tab2´ØÏ¢¤Î¥³¡¼¥É¤òºï½ü
  2. win1À¸À®Ä¾¸å¤Ë¥¿¥Ö¤ò¾Ã¤¹¥³¡¼¥É¤òÄɲá£win1.hideTabBar();
  3. ¥¿¥Ö¤Î¥¿¥¤¥È¥ë¤ª¤è¤Ó¥¢¥¤¥³¥ó²èÁüÀßÄê¤ò¥³¥á¥ó¥È¥¢¥¦¥È¡£// title: L('home'), // icon: '/images/KS_nav_ui.png',
  4. ¥¿¥Ö²èÁü¥Õ¥¡¥¤¥ë¤ò¥×¥í¥¸¥§¥¯¥È¤«¤éºï½ü
js¥Õ¥¡¥¤¥ë̾ÆâÍÆ
app.jsApplicationTabGroup¤òÀ¸À®¤·¤Æ³«¤­¤Þ¤¹¡£¥¿¥Ö¥ì¥Ã¥È¡¦¥¿¥Ö¥ì¥Ã¥È°Ê³°¡ÊiPhone¡¦Android¡Ë¤ÎȽÄê¤ò¤·¤Æ¡¢ApplicationTabGroupÀ¸À®»þ¤ËŬÀÚ¤ÊWindow¤òÅϤ·¤Æ¤¤¤Þ¤¹¡£
ui/handheld/ApplicationWindow.jsiPhone¤ª¤è¤ÓAndroidÍѤÎWindow¡£¥Ü¥¿¥ó¤ÇÊÌWindow¤ò³«¤­¤Þ¤¹¡£ÊÌ¥¦¥£¥ó¥É¥¦¤«¤é¤Ï¥Ê¥Ó¥²¡¼¥·¥ç¥ó¥Ð¡¼¤ÎÌá¤ë¥Ü¥¿¥ó¤ÇÌá¤ê¤Þ¤¹¡£self.containingTab.open(Ti.UI.createWindow(...));
ui/tablet/ApplicationWindow.js¥¿¥Ö¥ì¥Ã¥ÈÍÑ
ui/common/ApplicationTabGroup.jsÍ¿¤¨¤é¤ì¤¿Window¥¯¥é¥¹¤ò¸µ¤ËWindow2¤Ä¤òÀ¸À®¤·¡¢Tab¤ËÆþ¤ì¤Æ¡¢Tab¤òTabGroup¤Ëadd¤·¤Æ¤¤¤Þ¤¹¡£

HTML-based

html¤Ç¥¢¥×¥ê¤òºî¤ëºÝ¤Î¿÷·Á¤Ç¤¹¡£HTML¥Õ¥©¥ë¥À¤Ëhtml¥Õ¥¡¥¤¥ë¤Ê¤É¤òÆþ¤ì¤Æ¤ª¤¯¤È¡¢¥¢¥×¥êµ¯Æ°¸å¤Ë¤½¤ì¤é¤òWebView¤ËÆɤ߹þ¤ó¤Çɽ¼¨¤·¤Þ¤¹¡£

js¥Õ¥¡¥¤¥ë̾ÆâÍÆ
app.jsnew ApplicationWindow().open()
ui/ApplicationWindow.jsWebView¤òÀ¸À®¡£¼¡¤Î¤É¤ì¤«¤ÎApplicationWindowPlatform(window, webView, titleBarOn, drawerOn)¤ò¸Æ¤Ó½Ð¤¹¡£
ui/iphone/ui/ApplicationWindowPlatform.jsiOS¸ÇÍ­¤Î¥¢¥×¥ê½èÍý¡£html¥í¡¼¥É¸å¤Ë¥Ê¥Ó¥²¡¼¥·¥ç¥ó¥Ð¡¼¥¿¥¤¥È¥ëÀßÄê¡¢Ìá¤ë½èÍý¤Ê¤É
ui/android/ui/ApplicationWindowPlatform.jsAndroid¸ÇÍ­¤Î¥¢¥×¥ê½èÍý
ui/mobileweb/ui/ApplicationWindowPlatform.jsmobileweb¸ÇÍ­¤Î¥¢¥×¥ê½èÍý
ui/Drawer.jsiOSÍѤβ¼¤«¤é°ú¤­½Ð¤»¤ëÉôʬ¤Î¥×¥í¥°¥é¥à

¥ê¥ó¥¯

  • thapps ... ¥¿¡¼¥²¥Ã¥È¤òweb¤È¤·¤¿»þ¤Î¥Ç¥â