Xamarin.Android, Visual Studio - Designer doesn't work with v7 AppCompat library

2.4k views Asked by At

I want to create an app with Material Design using Xamarin and Visual Studio. I want to achieve this using the v7 AppCompat library, so my app runs well on older devices.

I have an activity with a toolbar and a button.

But in the Visual Studio Designer the layout isn't as it's supposed to be(No Material theme and no Toolbar):

Visual Studio Designer

But the strange thing is that it runs properly on my phone(without any changes made): My phone

How can I fix this?

2

There are 2 answers

5
amitairos On BEST ANSWER

Currently the Visual Studio Designer doesn't show Support Library elements.
You can use Xamarin Studio, which lately improved there Designer very much, and is easier to integrate with Visual Studio than Android Studio.
To download it go to http://download.xamarin.com/studio/Windows/XamarinStudio-6.0.2.73-0.msi (also available through your dashboard in www.xamarin.com under downloads, different versions).

EDIT: Currently you need to change the Cycle to beta (Help -> Check for Updates)

0
Jon Douglas On

This functionality is slated to be released in our Cycle 8 release(XVS 4.2.0.378 at the time of writing) to support AAR / Custom Views. You can find a link about this here:

https://developer.xamarin.com/releases/vs/xamarin.vs_4/xamarin.vs_4.2/#Android_Designer

It should be released to Stable shortly. For a non-beta/alpha workaround, I would highly recommend using this VS plugin for the time being which combines using Android Studio and Visual Studio to be the most productive when designing:

https://visualstudiogallery.msdn.microsoft.com/9f5a516a-f4d0-4228-9d25-d0273abebf33

For a more accurate timeline of these changes, you can view the latest blog article on the Beta channel:

https://releases.xamarin.com/beta-preview-1-cycle-8/

Upcoming Release Dates

Alpha – April 27th, 2016 (Evolve Conference)

Alpha 2 – July 13th, 2016

Alpha 3 – July 27th, 2016

Alpha 4 – Aug 2nd, 2016

Alpha 5– Aug 9th, 2016

Alpha 6 – August 12, 2016

Beta 1 – This Release!

Stable – Fall 2016

Thus if you wanted this functionality in your IDE, you will need to use XVS 4.2.X + in either the Alpha/Beta channels as of the time of writing.