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” columnand 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 see2 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, thenclose 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文件后可爱智能提示就出来了。。

更多相关文章

  1. Android调用WebAPI之传参、文件
  2. Android assets文件夹之位置放置和作用( AS 和eclipse中的 )
  3. Android中关于FTP的文件上传和下载
  4. android 权限定义的文件,位置
  5. Android Studio中src/main/res/values中strings.xml文件中字符串
  6. Android之SDK、NDK、JNI和so文件
  7. android通过chmod命令实现文件权限修改
  8. Android心得3.2--用SAX解析器解析xml文件内容

随机推荐

  1. 新增安全锁与“+1”特性 Android官方电子
  2. Android下用OpenGL画的一个旋转的圆形
  3. [Android] Android工程以jar包形式向第三
  4. 初学Android,字符串,数字,尺寸,数组资源(
  5. 依赖v7包和编译版本不一致问题####Error:
  6. Android 子线程更新UI的几种方法
  7. 【Android】代码实现模拟屏幕点击和键盘
  8. Android 修改Camera默认preview size预览
  9. 仿网易新闻顶部滑动条效果
  10. Android App程序运行过程 ActivityThread