Xamarin.Android 智能感知在 Visual Studio 2010 中不起作用 [英] Xamarin.Android Intellisense not working in Visual Studio 2010

查看:21
本文介绍了Xamarin.Android 智能感知在 Visual Studio 2010 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Visual Studio 2010 中测试 Xamarin.Android,并注意到我在处理 Android 布局 (.axml) 文件时没有 Android Intellisense.但是,当我在 .cs 文件中工作时,我确实获得了 Android Intellisense.

I'm testing out Xamarin.Android in Visual Studio 2010 and have noticed that I have no Android Intellisense when I'm working in an Android Layout (.axml) file. However, I do get Android Intellisense when I'm working in a .cs file.

示例:

这是位于我的 Layout 目录中的 Main.axml 文件的屏幕截图.请注意智能感知如何在 Android 命名空间中不包含任何内容.

Here is a screenshot of my Main.axml file that lives in my Layout directory. Notice how the intellisense doesn't contain anything within the Android namespace.

我需要做什么才能让智能感知在 .axml 文件中显示 Android 命名空间?

What do I need to do to get intellisense to display the Android namespace in a .axml file?

推荐答案

Kannan Balasubramanian 有发布了一个对我有用的答案(二进制位)

Kannan Balasubramanian has posted an answer that worked for me (Binary Bits)

这是 Kannan 的解决方案:

Here's Kannan's solution:

大多数在 Visual Studio 2012 中使用 Xamarin 的 Mono for Android 的人都面临一个错误,即 Intellisense 在源代码视图中不适用于 AXML.

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. 启动 Visual Studio 2012
  2. 打开一个包含 .AXML 文件的解决方案
  3. 现在 XML 主菜单应该在顶部可见
  4. 打开架构..."菜单
  5. 按文件名"列排序,看看android-layout-xml"和schemas.android.com.apk.res.android"是否存在.如果找到,请跳到第 13 步
  6. 如果未找到,请转到Program Files"(如果是 32 位系统)或Program Files (x86)"(如果是 64 位系统).
  7. 然后转到MSBuildNovell"或MSBuildXamarinAndroid"您应该能够看到 2 个文件android-layout-xml.xsd"和schemas.android.com.apk.res.android.xsd"
  8. 将这 2 个文件复制到Microsoft Visual Studio 11.0XmlSchemas"
  9. 再次打开第 3 步和第 4 步中提到的架构..."菜单
  10. 现在单击添加..."按钮并添加这两个文件,这些文件应位于步骤 7 中提到的位置8
  11. 现在重新启动 Visual Studio,用于设计布局的 XML 编辑器应该可以与 Intellisense 正常工作
  12. 从第 5 步开始......
  13. 如果上述步骤不起作用,请关闭 Visual Studio 2012.
  14. 现在在 Windows 程序菜单下打开VS2012 的开发人员命令提示符".
  15. 键入不带引号的Devenv/ResetSettings".
  16. 启动 Visual Studio 2012 并查看 Intellisense 是否有效.
  17. 如果仍然无法正常工作,最好转到 Xamarin 论坛并在那里发帖.

这篇关于Xamarin.Android 智能感知在 Visual Studio 2010 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆