Saad Qureshi
Saad Qureshi

Reputation: 738

Using xml from Android Studio on Xamarin

I have just started learning Xamarin and started importing my project from Android Studio manually to Xamarin on VS 2015.

I have noticed that Xamarin gives an error on certain UI elements like FloatingActionButton, DrawerLayout or anything from Android.Support library.

what should I configure on Xamarin to use these UI elements? If that is not possible, then what are the alternatives for Xamarin?

Upvotes: 1

Views: 1731

Answers (3)

Plac3Hold3r
Plac3Hold3r

Reputation: 5182

There is a nice extension for Visual Studio, XamarIDEA (Visual Studio Gallary). It allows you to easily work with XML layouts in Android Studio. Changes to XML files in Android studio are synchronized with the XML files in your Visual Studio Android Project.

Supports all XML Android files not just layout (color, styles, drawables, anim etc.)

It however does not support Xaml files. Any Xaml file in your project will be convert to XML to be able to use in Android studio. One caveat though is that it does not support previewing of custom controls (3rd party or your own making).

Upvotes: 2

Giorgi
Giorgi

Reputation: 30873

You are probably missing references in your new project. For DrawerLayout you need to reference Xamarin.Android.Support.v4 dll. For FloatingActionButton add Android Support Design Library :

Install-Package Xamarin.Android.Support.Design -Version 23.2.1

Upvotes: 0

Sven-Michael Stübe
Sven-Michael Stübe

Reputation: 14750

You have to install the nuget packages for the used support libraries.

e.g. support v4 for the DrawerLayout:

Install-Package Xamarin.Android.Support.v4

here is a list of all available libs:

https://www.nuget.org/packages?q=Xamarin+support

You can find them in the NuGet Package Manager in Visual Studio, too.

Upvotes: 2

Related Questions