博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Xamarin开发Android时Visual Studio 2012没有智能提示解决办法
阅读量:5095 次
发布时间:2019-06-13

本文共 2049 字,大约阅读时间需要 6 分钟。

Most of the people who work with Xamarin’s Mono for Android in Visual Studio 2012 face a bug where Intellisense doesn’t work for AXML in source view.

One of the fix which worked for me is mentioned below.

  1. Launch Visual Studio 2012
  2. Open a solution with .AXML file in it
  3. Now XML main menu should be visible on top
  4. Open “Schemas…” menu
  5. Sort by “File Name” column and see if “android-layout-xml” and “schemas.android.com.apk.res.android” are there. If found, skip to step 13
  6. If not found, go to “Program Files” if 32-bit system or “Program Files (x86)” if 64-bit system.
  7. Then go to “\MSBuild\Novell” or “\MSBuild\Xamarin\Android”
  8. You should be able to see 2 files “android-layout-xml.xsd” and “schemas.android.com.apk.res.android.xsd”
  9. Copy these 2 files to “\Microsoft Visual Studio 11.0\Xml\Schemas”
  10. Again open the “Schemas…” menu as mentioned in steps 3&4
  11. Now click “Add…” button and add these 2 files which should be located as mentioned in step 7 & 8
  12. Now restart visual studio and the XML editor for design layout should work fine with Intellisense
  13. From step 5….
  14. If above steps don’t work, then close the Visual Studio 2012.
  15. Now open “Developer command prompt for VS2012″ under Windows programs menu.
  16. Type “Devenv /ResetSettings” without quotes.
  17. Launch Visual Studio 2012 and see if Intellisense works.
  18. If still not working, better go to Xamarin  forums and post there.

注意:visual studio安装目录下会有一个 monodroidcatalog.xml文件,是好改成下面一样:[本人是64位,32位没有(86)]

<SchemaCatalog xmlns="http://schemas.microsoft.com/xsd/catalog">

<Schema href="%ProgramFiles(x86)%/MSBuild/Xamarin/Android/android-layout-xml.xsd" targetNamespace="http://schemas.android.com/apk/res/android" />
<Schema href="%ProgramFiles(x86)%/MSBuild/Xamarin/Android/schemas.android.com.apk.res.android.xsd" targetNamespace="http://schemas.android.com/apk/res/android" />

<Association extension="axml" schema="%ProgramFiles(x86)%/MSBuild/Xamarin/Android/android-layout-xml.xsd" />

</SchemaCatalog>

红色标记部分是我手动加上去的。保存此文件后本人重启vs,然后新建一个.axml文件后可爱智能提示就出来了。。

转载于:https://www.cnblogs.com/ywkpl/p/3898261.html

你可能感兴趣的文章
yii 跳转页面
查看>>
闭包问题
查看>>
C++:指针
查看>>
C#一个FTP操作封装类FTPHelper
查看>>
Linux运维基础入门(二):网络基础知识梳理02
查看>>
你所不知道的 CSS 阴影技巧与细节
查看>>
MyBatis框架的使用及源码分析(三) 配置篇 Configuration
查看>>
20172319 实验三《查找与排序》实验报告
查看>>
构造函数的继承
查看>>
Nginx的虚拟主机配置
查看>>
overflow 属性
查看>>
Java中多态的一些简单理解
查看>>
洛谷 1449——后缀表达式(线性数据结构)
查看>>
JZOJ 3.10 1539——三条直线
查看>>
[最小割][Kruskal] Luogu P5039 最小生成树
查看>>
Data truncation: Out of range value for column 'Quality' at row 1
查看>>
Dirichlet分布深入理解
查看>>
Javascript的调试利器:Firebug使用详解
查看>>
(转)Android之发送短信的两种方式
查看>>
使用vue脚手架搭建项目
查看>>