Xamarinãšã¯
.NET ïŒããæ£ç¢ºã«ã¯Monoã®å®è£ ïŒã«åºã¥ãã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ã®ã¯ãã¹ãã©ãããã©ãŒã éçºã®ãã¬ãŒã ã¯ãŒã¯ã¯ããã¹ãŠã®äž»èŠãªãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ïŒAndroidãiOSãWindows PhoneïŒããµããŒãããŠããŸãã 詳现ã«ã€ããŠã¯ãHabréã«ç¹°ãè¿ã èšèŒãããŠãããããç¹°ãè¿ãå¿ èŠã¯ãããŸããã
Xamarin.Formsãšã¯
äžèšã®ãã©ãããã©ãŒã ã®ããã€ãã«ã€ããŠãã€ã³ã¿ãŒãã§ãŒã¹ã®åäžã®ã¬ã€ã¢ãŠããããã«éçºã§ãããã¬ãŒã ã¯ãŒã¯ã ã¢ã€ãã¢ã¯æ¬¡ã®ãšããã§ããXamarinã³ã³ããŒãã³ãã«åºã¥ããŠäžåºŠã¬ã€ã¢ãŠããè¡ããã¿ãŒã²ãããã©ãããã©ãŒã ã§ã¯ãåã³ã³ããŒãã³ãã«å¯ŸããŠã¬ã³ãã©ãŒãåŒã³åºãããæ¢ã«ãã€ãã£ããªã³ã³ããŒãã³ããæç»ãããŸãã ã¬ã€ã¢ãŠãèªäœã¯ãã³ãŒããšXAML圢åŒã®äž¡æ¹ã§æºåã§ããŸãã 1幎åã®ãã㪠ãçµæã®ã€ã³ã¿ãŒãã§ã€ã¹ã®ã¬ã€ã¢ãŠããšãã¬ãã¥ãŒçšã®UIãŠãŒãã£ãªãã£ã¯ãŸã ãªããããã³ãŒãããUIãäœæãããªãã·ã§ã³ãéžæããŸããã
ãªãXamarin + Xamarin.Formsãéžæããã®ã§ããïŒ
ããã€ãã®çç±ããããŸããã
- ãµãŒããŒã§ã¯.NETãšCïŒã䜿çšããŠããããã3ã€ã®ã¢ããªã±ãŒã·ã§ã³ïŒãµãŒããŒãiOSãAndroidïŒã«1ã€ã®èšèªãšãã©ãããã©ãŒã ã䜿çšããã®ã¯éåžžã«äŸ¿å©ã§ããããèšèªããå¥ã®èšèªã«åãæ¿ããå¿ èŠã¯ãªãã䜿ãæ £ãããã¿ãŒã³ã䜿çšããæ©èœããããã©ã€ãã©ãªå ã®å ±éã®ãã©ã°ã¡ã³ããç°¡åã«éžæã§ããŸãããªã©.pã
- å©çšå¯èœãªãã¬ãŒã ã¯ãŒã¯ã®äžã§ãXamarinã¯æãéçºããããã®ã«èŠããŸããã
- HTML5ã¢ããªã±ãŒã·ã§ã³ãäœæãããªãã·ã§ã³ã«ã€ããŠã¯èæ ®ããŸããã§ãããã¢ããªã±ãŒã·ã§ã³ã§å€ãã®ãã©ãŒã ãèšç»ããããã®ç¹ã«é¢ãããã€ãã£ãã³ã³ããŒãã³ãã¯èããäºæž¬å¯èœãã€é«éã«åäœããŸãã ç¹ã«äœã³ã¹ãã®Androidã¹ããŒããã©ã³ã«é©ããŠããŸãã
- Xamarin.Formsã¯ãæå°éã®ãããã«ã§AndroidãšiOSã®å ±éã€ã³ã¿ãŒãã§ã€ã¹ãäœæã§ããå¯èœæ§ã«å ããiOSã®äœ¿ãæ £ãããããã¯ã¬ã€ã¢ãŠãã¢ãã«ãªã©ãå€ãã®å©ç¹ãåãã§ããŸãã
æåã®è¡
ææçãšã®éä¿¡ã®å§ãŸãã¯ã¢ã¯ãã£ããŒã·ã§ã³ã·ã¹ãã ã®åŸæã§å§ãŸããŸããïŒXamarin Webãµã€ãã®å人ã¢ã«ãŠã³ãã§æ¢ã«æ¯æãïŒ MSDNãµãã¹ã¯ã©ã€ããŒã®å Žå㯠999 ãã«ãŸãã¯799ãã« ïŒã衚瀺ãããŠããŸããããXamarin.Studioã¯é åºã«ã¢ããªã±ãŒã·ã§ã³ã®ãã«ããæåŠããŸããã ãææçã¯ã¢ã¯ãã£ããŒããããŠããŸãããã Xamarinãã¯ãã«ã«ãµããŒãã«ããæ¯æãã®æåã¢ã¯ãã£ããŒã·ã§ã³ã®ã¿ã圹ç«ã¡ãŸããã 圌ãã¯ããã«çããŸãããããããã«ãããããã¯çŽ æŽãããã¹ã¿ãŒãã§ããããã®åŸã®ãããžã§ã¯ãå šäœã®ããŒã³ãèšå®ããŸãã
ãšããã§ãç¡æè©Šçšçã§ã¯ãã³ã³ãã€ã«ãããã³ãŒãçšã«ãµã€ãºã64ãããã€ããè¶ ããã¢ããªã±ãŒã·ã§ã³ããã«ãããããšã¯ã§ããŸããã ã€ãŸããããšãã°ãåãjson-serializerïŒNewtonsoftïŒãæ¥ç¶ããŸããããã§ãã¢ããªã±ãŒã·ã§ã³ããã«ãã§ããªããªããŸãã ããã
IDEã®åé¡
Xamarinã¯ã MonoDevelopã«åºã¥ããŠç¬èªã®Xamarin.Studio IDEãæäŸããŸãã æ®å¿µãªããããã®IDEã«ã¯ããã€ãã®åé¡ããããŸãã
- äžå®å®ã ããšãã°ãã¢ããªã±ãŒã·ã§ã³ã®ã¢ã»ã³ããªãäžæããããšãããšãåºãããªãŒãºããå¯èœæ§ãéåžžã«é«ããªããŸãã
- ããã¯ã©ã€ããå®æçã«äžæãããããªãŒãã³ã³ããªãŒãããŸãã
- èªåè£å®ã¯ãçŸåšã®ããŒã ã¹ããŒã¹ã«ãªãã¯ã©ã¹ãæ¢ãæ¹æ³ãç¥ããŸããããã¯ã©ã¹ãžã®å®å šã«èšè¿°ãããåŒã³åºãã䜿çšããŠå¿ èŠãªäœ¿çšç°å¢ãäœæã§ããŸãã
- ãªãã¡ã¯ã¿ãªã³ã°ã®æ©äŒã¯æããã«ååã§ã¯ãããŸããã圌女ã¯ãã®ç¹ã§Resharperããã¯ã»ã©é ãã§ãã
- XIBãšãã£ã¿ãŒïŒiOSã®ã¬ã€ã¢ãŠããã¡ã€ã«ïŒãšã®çµ±åã¯å®æçã«äžæããŸãã XIBãŸãã¯ã¹ããŒãªãŒããŒããä»ããŠã¬ã€ã¢ãŠãã䜿çšããå ŽåãXcodeã¯ç·šéã®ããã«éããéãããšãUIã«é¢é£ä»ããããèªåçæãããã¯ã©ã¹ãæŽæ°ãããŸãã ããããåžžã«ã§ã¯ãããŸããã ç°å¢ã¯ãååãšããŠãäžéšãŸãã¯ãã¹ãŠã®ãã¡ã€ã«ã®Xcodeã®åŒã³åºããåæ¢ããå ŽåããããŸãã ã¹ã¿ãžãªã®ãã£ãã·ã¥ãã¯ãªã¢ããããšã§åŠçãããŸãïŒ ã/ Library / Caches / XamarinStudio-5.0ãã£ã¬ã¯ããªã®ã³ã³ãã³ããåé€ããŸãïŒã
ããããè¯ããã¥ãŒã¹ããããŸãïŒ ããžãã¹æéã§ã¯ãVisual Studioãšã®çµ±åããããããã§Visual Studioã§ã³ãŒããèšè¿°ã§ããŸãã ããã¯éåžžã«ããŸãæ©èœããŸãã ããšãã° ãããã€ãã®åé¡ããããŸãã ããšãã° ããããŸã§AndroidãXAMLã䜿çšããŠããªãã£ãããã ãã®ãããªåé¡ã¯çºçããŠããŸããã ãããã圌ãã¯ä»ã®äººã«åºããããŸããã
å®éã®ãšãããiOSã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããã«ã¯ãMac OS XãæèŒããã³ã³ãã¥ãŒã¿ãŒãŸãã¯ä»®æ³ãã·ã³ãå¿ èŠã§ããããã«ã¯2ã€ã®ãªãã·ã§ã³ããããŸãã
- Macã§å®è¡ãããŠããXamarin Studioããã¢ããªã±ãŒã·ã§ã³ããã«ãããŠãããã°ãã
- Visual StudioãšãããŒïŒãã«ããã¹ãïŒã®çµ±åã«ãã©ã°ã€ã³ã䜿çšãããšãVSããã·ãã¥ã¬ãŒã¿ã§ãã«ãããã³å®è¡ããã»ã¹ãéå§ããããã§ãããã°ã§ããŸãã ãã ããã¢ããªã±ãŒã·ã§ã³ãå®è¡ããå Žåãã·ãã¥ã¬ãŒã¿ãŒã®ç»åã¯ãŸã Macäžã§ã®ã¿æç»ãããããã2å°ã®PCãåæã«äžŠã¹ãŠãäžæ¹ã®ã¢ããªã±ãŒã·ã§ã³ããã¹ãããä»æ¹ã®ãããã¬ãŒã§äœæ¥ããå¿ èŠããããŸãã
ããã«ãçµ±åãã©ã°ã€ã³ã¯é·ãéäžå®å®ã§ããã ãã®ç¶æ³ã¯å®æçã«çºçããŸããã3人ã®éçºè ãå šå¡ãåãããŒãžã§ã³ã®OSãstudioãXamarinãªã©ã䜿çšããŠããŸãã ãããã¯åãã±ã·ã«é çªã«æ¥ç¶ãããŸãã ãã®çµæã1ã€ã§ã¯ãã¹ãŠãæ£åžžã«æ©èœãã2ã€ç®ã§ã¯ãã¬ãŒã¯ãã€ã³ããç¡èŠããã3ã€ç®ã§ã¯ãŸã£ããæ©èœããŸããã
ãã¯ãã«ã«ãµããŒãã¯ãMacãšWindowsçšã®ææ°ã®4ã€ã®ããŒãžã§ã³ãè©Šãããã«ã¢ããã€ã¹ããŸããããããããããã€ãã®çµã¿åãããæ©èœããã§ããããã ã€ã³ã¹ããŒã«ã«ã¯20ã30åããããŸãã ã€ã³ã¹ããŒã©ãŒã¯ãååããŠã³ããŒãããã³ã³ããŒãã³ãïŒAndroid SDKã©ã€ãã©ãªãŒãªã©ïŒãããŠã³ããŒãããŸãã ã ãšæã...
ãã ãããã©ã°ã€ã³ãæ£åžžã«æ©èœããå Žåã§ãã次ã«Visual Studioã§ãããžã§ã¯ããéããšããããã¯ãŒã¯ãåæãããããããšãã°Macããªãã«ãªããŸãããã©ã°ã€ã³ã¯ããã«ããã¹ãã®æ€çŽ¢ã§ãã³ã°ããå¯èœæ§ããããŸãã ãããŠãã·ã¹ãã ã¬ãžã¹ããªã«ç§»åããŠãããã«ãããã«ããã¹ãã®ä¿åããããã©ã¡ãŒã¿ãŒãåé€ããªããã°ãªããªãã£ãå Žåãããã£ã³ã»ã«ããåžžã«æ©èœãããšã¯éããŸããã
ãããã£ãŠãç§ãã¡ã¯æ¬¡ã®ããã«é·ãéåããŠããŸããã
- ã³ãŒãã¯ãMacã§äœ¿çšå¯èœãªãããã¯ãŒã¯ãã©ã«ããŒãšããã®äžã§å®è¡ãããŠããParallels Windowsä»®æ³ãã·ã³ã«ãããŸãã
- ã»ãšãã©ã®ã³ãŒãã¯ããã®ä»®æ³ãã·ã³å ã®Windowsã®Visual Studioã§èšè¿°ãããŠããŸãã
- æçµããŒãžã§ã³ã®ãããã°ãŸãã¯ã¢ã»ã³ããªã¯ãMac OS Xã®Xamarin.Studioã§è¡ãããŸããããã©ã°ã€ã³ã§ã¯ãªããå ±æãã©ã«ããŒã®åãã³ãŒããæåã§éããŸãã
ããŠãå°ããªãã©ãã«ããïŒiOSã§ãããžã§ã¯ããéããã³ã«ããã©ã°ã€ã³ã¯ãã«ããã¹ããžã®æ¥ç¶ãææ¡ãã質åã«çãããŸã§ãããžã§ã¯ãã®ãããªãããŒãããããã¯ããŸãã
幞ããªããšã«ãäœã¶æãèŠããã åŸãXamarinããŒã ã¯ç§ãã¡ã«åæ ããŸããã Xamarin.Studioã®ææ°ã®æŽæ°ããã°ã©ã ã¯ãã®åé¡ã解決ããŸãã-ãªã¢ãŒããããŒã«æ¥ç¶ããããã®ãŠã£ã³ããŠã«ããæ¥ç¶ãŠã£ã³ããŠã衚瀺ããªãããã§ãã¯ããŒã¯ã衚瀺ãããŸããã
ãããããã¯ãŸããç¬èªã®XamarinãŠãŒãã£ãªãã£ã§ã¯ãªããMac OS Xã®éåžžã®ãªã¢ãŒããŠãŒã¶ãŒãä»ããŠããªã¢ãŒããã«ããå®è¡ããŸãã
ãã®çµæãæ¥ç¶ã¯éåžžã«å®å®ãã10ã®ãã¡8ã€ã®ã±ãŒã¹ã§ãããã°ãæ£åžžã«éå§ãããŸãããããããããã«ããŠããã·ãã¥ã¬ãŒã¿ãŒã¯å¥ã®PCã§å®è¡ãããŸãã ãããã°ã¯ãã·ã³äžã«ãããã¢ããªã±ãŒã·ã§ã³ã¯ããã§å®è¡ãããŠãããPCã«ç»åã¯è¡šç€ºãããŸããã ãªã¢ãŒãã»ãã·ã§ã³ãéããã2å°ç®ã®ã³ã³ãã¥ãŒã¿ãŒãåãããŒãã«ã«ä¿æã§ããŸãã
ãœãªã¥ãŒã·ã§ã³ã¯ãŸã ããããããŸãŸã§ãããXamarin Studioã®äœ¿çšãå®å šã«æŸæ£ããããšãã§ããŸãïŒ ä¿¡ããŠãã ãããæ°ã¶æäœãã åŸãç§ãã¡ã¯ç¢ºãã«èšãããšãã§ããŸãïŒããã¯äŸ¡å€ããããŸãã
ãããã¡ã€ãªã³ã°ã«åé¡ããããŸãã iOSã¢ããªã±ãŒã·ã§ã³ã®Xamarin.Profiler ïŒ Monoãã°ãããã¡ã€ã©ãŒã® GUIã©ãããŒïŒã¯ãé·ãéãäœæããã¯ã©ã¹ã®ååã衚瀺ããŸããã§ããããã®ãããªãã€ãã£ããªããžã§ã¯ããããã»ããµæéãšã¡ã¢ãªãå æãããšããæ å ±ãããããŸããã§ããããäœæããã¯ã©ã¹ãšããããæ¯èŒããæ¹æ³ã¯å°ãã§ã¯ãããŸããæããã§ã¯ãããŸããã ããã§ç¶æ³ã¯æ¹åãããŸãã-æžãããã¯ã©ã¹ãã€ãã«ãªã¹ãã«ç»å ŽããŸããã
ãŸãããããã¡ã€ã©ãŒã®äžã§ã¯ãã¢ããªã±ãŒã·ã§ã³ã®å®è¡ãéåžžã«é ããªãããã®çµæãèµ·åã«å²ãåœãŠãããæéå ã«æåã®ç»é¢ã衚瀺ããæéããªãå ŽåããããiOSã¯ãããæã¡è² ãããŸãã ãŸããã¢ããªã±ãŒã·ã§ã³ãèµ·åããå Žåããããã¡ã€ã©ãŒã®äžã®ã·ãã¥ã¬ãŒã¿ãŒã§äœæ¥äžã«ã¯ã©ãã·ã¥ããå¯èœæ§ããããŸãã 匱ãèšãèš³ãšããŠããããã¡ã€ã©ãŒãé·ãéã¢ã«ãã¡çã®æ®µéã«ãããéå»1幎éã§å°ãªããšããå®å®ããããŒã¿çãã®æ®µéã«å°éããŠããªãããšãããããŸãã
ã¯ãã¹ãã©ãããã©ãŒã ã®åé¡
次ã®2ã€ã®æ¹æ³ã®ããããã§ã¯ãã¹ãã©ãããã©ãŒã ã³ãŒããèšè¿°ããããšãã§ããŸãã
- å ±æãããžã§ã¯ã ã ãã®ãããžã§ã¯ãã®ã³ãŒãã¯ãåå¥ã®ã¢ã»ã³ããªã«ã³ã³ãã€ã«ãããã®ã§ã¯ãªããäžåºŠã«è€æ°ã®ãããžã§ã¯ãã®äžéšãšããŠèªåèªèº«ãåçŽã«ã€ã³ã¯ã«ãŒãããŸãã äžçš®ã®simlinkãããžã§ã¯ãã
- PCLã©ã€ãã©ãª ã ïŒPortable Class LibraryïŒã¯ãã¹ãã©ãããã©ãŒã ã©ã€ãã©ãªã
çè«çã«ã¯ã1ã€ã®ããšãéžæããããã«æ±ããããŸãã å®éã«ã¯ããããã®æ¹æ³ã®äž¡æ¹ã䜿çšããŸããã
PCLãããžã§ã¯ãã§ã¯ãããŒã¿ããŒã¹ããããã¯ãŒã¯ãªã©ãšé£æºããŠããã¹ãŠã®ããžãã¹ããžãã¯ãäœæããŸããã äž»ãªå©ç¹ã¯ãPCLããã©ãããã©ãŒã ã®1ã€ã«å®è£ ãããŠããªãã·ã¹ãã ã¯ã©ã¹ã®äœ¿çšãèš±å¯ããªãããšã§ãã ãããã£ãŠãPCLå ã§èšè¿°ããã³ã¢ã»ã³ãã«ãããã³ãŒãã¯ãéžæããããã¹ãŠã®ãã©ãããã©ãŒã ã§å®è¡ãããããšãä¿èšŒãããŠããŸãã
æ¬ ç¹ã¯ãPCLã©ã€ãã©ãªããéžæããããã¹ãŠã®ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®æ©èœã®å ±ééšåã«åºã¥ããŠèšè¿°ãããŠããããããããã®1ã€ã«æ¬ ããŠãããã®ã䜿çšã§ããªãããšã§ãã ã€ãŸããiOSãšAndroidã®ã¿ã䜿çšããäºå®ã§ãäžéšã®å¿ èŠãªæ©èœãWindows Phoneã«ãªãå Žåã¯äœ¿çšã§ããŸããã åæã«ããµããŒãããããã©ãããã©ãŒã ãå®çŸ©ããPCLçšã®ããããã¡ã€ã«ãã®ã»ããããããŸãããå·çæç¹ã§ã¯ããiOSãšAndroidã®ã¿ãWindows PhoneãšWindowsãªãããéžæããããšã¯äžå¯èœã§ãã
ãã®çµæãiOSãšAndroidã§åäœããããšãä¿èšŒãããŠããããPCLã§ãã«ãã§ããªãå ±æã¢ã»ã³ããªã³ãŒããè¿œå ããŸããã ããšãã°ãgzipã®åçãããããã¯ãŒã¯ãŸãã¯ããŒã¿ããŒã¹ã§ã®äœæ¥ã«é¢ãããã®ä»ã®è©³çŽ°ããµããŒããããŠããŸãã
PCLã§ã¯ããã¡ã€ã«ã®æäœãªã©ãäºçŽ°ãªããšã¯ãªããããããŸããã -ãã®å ŽåãPCLã¢ã»ã³ããªã«ã€ã³ã¿ãŒãã§ãŒã¹ãååšããç¹å®ã®OSã®å®è£ ããã§ã«ãããžã§ã¯ãã«ãããšæ³å®ãããŠããŸãã ç§ãã¡ã®å Žåããããã®å®è£ ã®äžéšã¯ãå ±æã¢ã»ã³ããªã«ãªããŸããã
ãšããã§ãPCLã®ãããã¡ã€ã«ãéžæããå Žåã¯ã259ã®ãããã¡ã€ã«ãéžæããããšããå§ãããŸã ã å©çšå¯èœãªãã¹ãŠã®æ©èœã«æé©ã§ãã ããšãã°ããã¥ãŒããã¯ã¹ãã¹ã¬ããã»ãŒããªèŸæžãå«ãŸãªãå¥ã®ãã®ããå§ããŸãã-ããªãã¯æã§æžãããšãã§ããŸããããªãã§ããïŒ ãŸãããããã¡ã€ã«ã®éžæã¯ãVisual Studioã§ã¯ãªãXamarin.Studioã®æ¹ãã¯ããã«äŸ¿å©ã§æ確ã§ããããšã«æ³šæããŠãã ããã
ãŸããPCLã®å¥ã®æ©èœïŒ1ã€ã®PCLã©ã€ãã©ãªã«å¿ããŠç°ãªããããã¡ã€ã«ãæã€å¥ã®PCLã©ã€ãã©ãªãè¿œå ããããšã¯ã§ããŸããã ããæ£ç¢ºã«èšãã°ãè¿œå ããããšã¯ã§ããŸããããã¹ãŠã®ãããã¡ã€ã«ããã¹ãŠã®ãããã¡ã€ã«ã«å¯Ÿå¿ãããšã¯éããŸããã äžè¬ã«ãPCLã®æŠå¿µã¯äžè¬çã«äœ¿çšå¯èœã§ãããç¹ã«çœç±ãåŒãèµ·ããå¯èœæ§ããããŸãã
ãã€ãã£ããã©ãããã©ãŒã æ©èœãžã®ãã€ã³ãã®åé¡
Xamarinã®åºæ¬çãªèãæ¹ã¯ããã€ãã£ãã³ãŒããèšè¿°ãããšãã«äœ¿çšããã®ãšåãã¯ã©ã¹ãã¡ãœãããããã³æ§é ã䜿çšããŠã³ãŒããèšè¿°ã§ãããšããããšã§ããããã¯ãCïŒã§èšè¿°ãããã°ããã§ãã ãããã埮åŠãªéãããããŸã...
iOSã®å Žåãããªã²ãŒãã«ã¯ããªãèå³æ·±ããã°ããããŸãã ããã¯ãããšãã°ã UIScrollViewã³ã³ããŒãã³ãã§ãã ç¹å®ã®ã€ãã³ããåŠçããããªã²ãŒããå²ãåœãŠããããããã®ã€ãã³ããçŽæ¥ãµãã¹ã¯ã©ã€ãã§ããŸãã
var scrollView = new UIScrollView(); // 1 class UIScrollViewDelegate1: UIScrollViewDelegate { public override void ScrollAnimationEnded(UIScrollView scrollView) { base.ScrollAnimationEnded(scrollView); Debug.WriteLine("Yes, animation ended"); } } scrollView.Delegate = new UIScrollViewDelegate1(); // 2 scrollView.ScrolledToTop += (_, __) => { Debug.WriteLine("Yes, scrolled to top"); }; scrollView.ScrollAnimationEnded += (_, __) => { Debug.WriteLine("Yes, animation ended"); };
ããã«ã ScrollAnimationEndedã€ãã³ãããµãã¹ã¯ã©ã€ããããšã ããªã²ãŒãã¯èªåçã«å éšXamarinã«çœ®ãæããããŸãã ãŸãã ScrolledToTopã€ãã³ãã®ãµãã¹ã¯ãªãã·ã§ã³ã¯å€±ãããŸãã ã©ããã-åé¡ã¯äœã§ããïŒ ã€ãã³ããšããªã²ãŒãã1ã€ã®ã³ãŒãã«æ··åšãããªãã§ãã ããïŒ ããããæã«ã¯åé¡ã®ç¶æ³ããããŸãïŒ
- ã³ã³ããŒãã³ãã«ã¯ç®çã®ã€ãã³ãããããŸããããããªã²ãŒãã«ååšããŸãã
- ã³ã³ããŒãã³ãã§ã¯ãããã€ãã®ãã³ãã©ãŒãæã€ã«ã¹ã¿ã ããªã²ãŒããXamarinèªäœã«ãã£ãŠæ¢ã«å²ãåœãŠãããšãã§ããŸãã
ãŸãã¯ãããšãã°ãXamarin.iOSã§ã¯ãã¯ã©ã¹ã¯2ã€ã® iOSãããã³ã«UITableViewDataSourceããã³UITableViewDelegateã眮ãæããåäžã¯ã©ã¹UITableViewSourceã䜿çšããŸã ã ããã¯ãããã«ãããããããŸããã
ã¡ãœãããšã¯ã©ã¹ã®ã·ã°ããã£ãæã å€æŽãããåãiOSã³ã³ã¹ãã©ã¯ã¿ãŒfileURLWithPathãCreateFileUrl㧠Xamarinã«å€ãããŸããã
Androidã§ãåæ§ã®ç¶æ³ãçºçããŸããå ã®GONEå®æ°ã¯Viewã¯ã©ã¹ã«ãããXamarinããŒãžã§ã³ã§ã¯åãç®çã§ãå€Goneãæã€åæåViewStatesããããŸãã ä»ã®ã¡ãœãããå®æ°ã«ãåæ§ã®åé¡ãããããã€ãã£ããã©ãããã©ãŒã ããåãæ¿ãããšãã«æ··ä¹±ãçããŸãã
ãã©ãããã©ãŒã æ©èœã®æœè±¡åã®æ¬ åŠ
å®å šãªå¹žçŠã®ããã«ããã¬ãŒã ã¯ãŒã¯ã¯ç¹å®ã®OSã®æ©èœã®äžéšãé ããŸããã ããšãã°ããããã¯ãŒã¯ã§ã®ããã¯ã°ã©ãŠã³ãäœæ¥ïŒ
- Androidã§ã¯ããããã¯ãŒã¯ãŸãã¯ããã¯ã°ã©ãŠã³ããããã¯ãŒã¯ãµãŒãã¹ãæäœããããã®æ°ããã¹ã¬ãããç°¡åã«äœæã§ããŸããã¢ããªã±ãŒã·ã§ã³ãæå°åãããŠããå ŽåããŸãã¯é»è©±ãããã¯ãããŠããå Žåãäœæ¥ã¯åæ¢ããŸããã
- iOSã§ã¯ãæå°åãããšã¢ããªã±ãŒã·ã§ã³ãåæ¢ããŸãããããã¯ãŒã¯ã§äœãããããå Žåã¯ãæå°åã®æ°ååŸã«åæ¢ããããã¯ã°ã©ãŠã³ãã»ãŒãã¿ã¹ã¯ãªã©ã®å¥ã®ãªãã·ã§ã³ã䜿çšããå¿ èŠããããŸãã
ããªãã¯èšã-ãããã¯ç¹å®ã®ãã©ãããã©ãŒã ã®åãªãæ©èœã§ããïŒ ãŸãã«ã ããããéçºè ã®èª°ããããã®æ©èœãæœè±¡åã®äžã«é ããŠããªãã®ã§ãç¹°ãè¿ããŸãããåãã©ãããã©ãŒã ã調æ»ããå¿ èŠããããŸã ã
ãµãŒãããŒãã£ã®ã³ã³ããŒãã³ãã®æ¬ åŠ
çŸæç¹ã§ã¯ã å€ãã®ã³ã³ããŒãã³ãããã§ã«Xamarinã§èšè¿°ãããŠããŸãããiOSããã³Androidã§ã¯ããã«å€ãèšè¿°ãããŠããŸãã å¿ èŠã«å¿ããŠãçè«çã«ã¯Object-CãŸãã¯Javaã§èšè¿°ããããã€ããªã©ã€ãã©ãªãæ¥ç¶ã§ããŸããããã€ãã£ãã©ã€ãã©ãªãšXamarinã¢ããªã±ãŒã·ã§ã³éã®éä¿¡çšã®ãããžã§ã¯ããã€ã³ãã£ã³ã°ãèšè¿°ããå¿ èŠããããŸãã iOSã®å Žåããã®ãããªãããžã§ã¯ããåå¥ã«çæã§ããObjective SharpieãŠãŒãã£ãªãã£ã¯å€§ãã«åœ¹ç«ã¡ãŸãããåžžã«100ïŒ ç¢ºå®ã«æ©èœããããã§ã¯ãªãããã®ãããªçæã®çµæãæäœæ¥ã§ç·šéããªããã°ãªããªãããšããããŸããããã®ã©ã€ãã©ãªãå¿ èŠãã©ããããçåã«æãããšããããŸãã
ããã«ãäœæè ã¯ãã©ã€ãã©ãªã®ãã€ãã£ãããŒãžã§ã³ãšæ¯èŒããŠããã®ãããªã³ã³ããŒãã³ããé ããŠæŽæ°ããããšããããããŸãã TestFairyãã©ã°ã€ã³ããã€ãã£ãããŒãžã§ã³ãããæ°ãæé ããŠãããšããç¶æ³ã«çŽé¢ããŸããã TestFairyã®æè¡ãµããŒãããå°ãããããšããã圌ãã¯ãã¹ãŠãããŸããã£ãŠãããšçããŸãããããªãã¯ããã€ãã®å°ããªæ©èœãé€ããŠäœã倱ãããšã¯ãããŸããã ããããXamarinã®æ°ããããŒãžã§ã³ããªãªãŒã¹ããããšããåé¡ãçºçããŸããããã®ããŒãžã§ã³ã®Xamarinã§ã³ã³ãã€ã«ããããã®ã©ã€ãã©ãªãæã€ã¢ããªã±ãŒã·ã§ã³ã¯ããªã¢ã«ã¿ã€ã ã§ã¯ã©ãã·ã¥ãå§ããŸããã
çµè«
ãã¬ãŒã ã¯ãŒã¯ã®è€éããç 究ããåŸãçµè«ã¯ããèªèº«ã瀺åããŠããŸãã
- Xamarinã䜿çšãããšãã¢ãã€ã«ãã©ãããã©ãŒã CïŒããã³.NETã®éçºã«äŸ¿å©ã«äœ¿çšã§ããŸãïŒããã€ã泚æç¹ããããŸãïŒã
- Xamarinã¯ããã®å¹Žéœ¢ã«ãããããããããªãç²éãªè£œåã§ãã
- Xamarinã¯ãåã¢ãã€ã«ãã©ãããã©ãŒã ã®æ©èœãæ éã«æ€èšããå¿ èŠããããªããæããŸããã
ãã®èšäºã§ã¯Xamarin.Formsã«é¢ããã¹ããŒãªãŒãèšç»ããŸãããããã®ã»ã¯ã·ã§ã³ã¯éåžžã«æ¡åŒµãããŠãããããå¥ã®èšäºã«åããããšã«ããŸããã ãã®äžã§ãXamarin.Forms UIãã¬ãŒã ã¯ãŒã¯ã®ããŸããŸãªåé¡ãšãã®è§£æ±ºæ¹æ³ã«ã€ããŠèª¬æããŸãã
æŽæ°ãã 2çªç®ã®éšåãžã®ãªã³ã¯ã