简体   繁体   English

如何在Xamarin.Android的AXML上启用intellisense?

[英]How to enable intellisense on Xamarin.Android's AXML?

Since this great tool became free for everyone, I tried it, and I liked it especially Visual Studio Android emulator. 由于这个伟大的工具对所有人都免费,我尝试了,我喜欢它特别是Visual Studio Android模拟器。

But, I got a problem because Visual Studio intellisense does not work at all for axml files. 但是,我遇到了一个问题,因为Visual Studio intellisense对axml文件根本不起作用。

I tried this article ( https://kb.xamarin.com/customer/portal/articles/1920119-how-do-i-enable-intellisense-in-android-axml-files- ) but those files (android-layout-xml.xsd, schemas.android.com.apk.res.android.xsd) does not exist in my PC 我试过这篇文章( https://kb.xamarin.com/customer/portal/articles/1920119-how-do-i-enable-intellisense-in-android-axml-files- ),但那些文件(android-layout-)我的电脑中不存在xml.xsd,schemas.android.com.apk.res.android.xsd)

  1. Download this two files ( https://raw.githubusercontent.com/atsushieno/monodroid-schema-gen/master/schemas.android.com.apk.res.android.xsd and https://raw.githubusercontent.com/atsushieno/monodroid-schema-gen/master/android-layout-xml.xsd ) to "C:\\Program Files (x86)\\MSBuild\\Xamarin\\Android" (if there is no such files there). 下载这两个文件( https://raw.githubusercontent.com/atsushieno/monodroid-schema-gen/master/schemas.android.com.apk.res.android.xsdhttps://raw.githubusercontent.com/atsushieno /monodroid-schema-gen/master/android-layout-xml.xsd )到“C:\\ Program Files(x86)\\ MSBuild \\ Xamarin \\ Android”(如果那里没有这样的文件)。
  2. Start "Developer Command Prompt for VS2015" 启动“VS2015的开发人员命令提示符”
  3. Execute "devenv /resetsettings" 执行“devenv / resetsettings”
  4. Open *.axml file in your solution with "Open with" and select "Automatic editor selector (XML)" 使用“打开方式”在解决方案中打开* .axml文件,然后选择“自动编辑器选择器(XML)” 自动编辑器选择器(XML)

  5. If intellisence still not working go to XML -> Schemas, add this schemas manually and restart visual studio. 如果intellisence仍无效,请转到XML - > Schemas,手动添加此模式并重新启动visual studio。

  6. Enjoy! 请享用! Intellisenseworks

The XSD files are located at C:\\Program Files (x86)\\Xamarin Studio\\AddIns\\MonoDevelop.MonoDroid\\schemas , note that this path exist when you install the Xamarin Studio. XSD文件位于C:\\ Program Files(x86)\\ Xamarin Studio \\ AddIns \\ MonoDevelop.MonoDroid \\ schemas ,请注意,安装Xamarin Studio时存在此路径。

I guess, we don't ship these files with Visual Studio plugin, I will have to confirm this with Xamarin.Android team. 我猜,我们不会使用Visual Studio插件发送这些文件,我将不得不与Xamarin.Android团队确认这一点。

Meantime you can find the schema files at https://forums.xamarin.com/discussion/comment/180685/#Comment_180685 同时,您可以在https://forums.xamarin.com/discussion/comment/180685/#Comment_180685找到架构文件。

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

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