【问题标题】:Xamarin axml, xml Intellisense not workingXamarin axml,xml Intellisense 不工作
【发布时间】:2019-05-16 22:29:45
【问题描述】:

我开始使用版本 15.7.4 的 Visual Studio 2017 企业版。和 Xamarin 版本 4.10.0 并且需要在 Xamarin 本机 android 应用程序上工作。

但自动填充建议没有出现在 xml and axml 文件中。 Intellisense 为小部件名称工作(如 TextView, EditText 等)在布局 axml 文件中。但是,对于小部件属性(如android:layout_width, android:gravity 等),它不起作用。在styles.xml, menu.xml 中的建议根本没有出现。我通过以下方式检查。

1) XML - 架构 > android-layout-xml.xsdschemas.android.com.apk.res.android.xsd 文件存在

2) 作为 XML(文本)编辑器打开的文件

3) 我在工具中没有找到Resharper

另外,有没有办法将 Xamarin 键盘快捷键更改为 Android Studio 或 Eclipse?

【问题讨论】:

  • 您可以使用键盘上的Tab 键自动填充。不幸的是,某些属性无法在 Xamarin 中显示,如 Android Studio 或 Eclipse。我认为这将在以后的 Visual Studio 版本中更新。

标签: android xamarin xamarin.forms xamarin.android visual-studio-2017


【解决方案1】:

作为 Xamarin 开发人员将近两年,我已经接受了这样一个事实,即 Xamarin Android 智能感知从未按预期工作。

它有很多错误和问题(下面的链接),这使得它非常痛苦,但是你已经在上面提到了一些解决方法,如果这些方法不起作用你相信我什么都不会。

https://forums.xamarin.com/discussion/118384/android-designer-does-not-work-well https://forums.xamarin.com/discussion/125879/designer-not-loading-layout-at-all https://forums.xamarin.com/discussion/76851/visual-studio-2015-android-designer-not-working https://forums.xamarin.com/discussion/82082/android-designer-not-working-in-visual-studio-enterprise-2015 https://forums.xamarin.com/discussion/6258/android-designer-doesnt-work-in-vs-2012 https://developercommunity.visualstudio.com/content/problem/99268/xamarin-android-designer-not-working.html

我的建议

Android Studio 为您提供了一个非常强大的设计器,因此我只是建议您使用 Android Studio 写下您的 XML,然后将其复制粘贴到您的 Xamarin AXML/XML 文件中,它应该像一个魅力一样工作,同样可以对于任何其他时间的文件,例如字符串或样式 XML。

要更改 Visual Studio 快捷方式,您只需检查 following guide

【讨论】:

  • 如果我在 Android Studio 中准备布局、样式、drawables 不会有任何问题,然后我将其复制到 xamarin?
  • 当然最后不会是Android 记住,如果有我为什么要推荐给你?
猜你喜欢
  • 1970-01-01
  • 2017-01-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-11-09
  • 2015-07-19
  • 1970-01-01
  • 2018-07-10
相关资源
最近更新 更多