Xamarin axml, xml Intellisense not working

2019-08-25 07:00发布

问题:

I started using Visual Studio 2017 Enterprise Edition with Version 15.7.4. and Xamarin Version 4.10.0 and need to work on Xamarin native android application.

But Auto fill suggestions not coming in xml and axml files. Intellisense working for widget names(Like TextView, EditText etc.) In layout axml files. But, for widget properties (Like android:layout_width, android:gravity etc.) it isn't working. Where as in styles.xml, menu.xml suggestions not coming at all. I check with following ways.

1) XML - Schemas > android-layout-xml.xsd and schemas.android.com.apk.res.android.xsd files are exists

2) File opened as XML (Text) Editor

3) I didn't find Resharper in Tools

Also, Is there any way to change Xamarin keyboard shortcuts to Android Studio or Eclipse?

回答1:

Being a Xamarin developer for almost two years I have come to terms with the fact that the Xamarin Android intellisense has never worked as it is expected.

It has a lot of bugs and issues (Links below) which have made it a real pain in the neck, But there are workarounds which you have already mentioned above and if those do not work for you trust me nothing will.

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

My suggestions:

Android studio provides you with a very strong designer and hence I would simply suggest you use Android studio to write down your XML and then just copy paste it to your Xamarin AXML/XML files and it should work like a charm, Same can be done for any other time of files such as strings or styles XML.

For changing the visual studio shortcuts you can simply check the following guide