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

浪子不回头ぞ 提交于 2019-12-08 02:01:45

问题


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):

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

How can I fix this?


回答1:


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)




回答2:


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.



来源:https://stackoverflow.com/questions/39056960/xamarin-android-visual-studio-designer-doesnt-work-with-v7-appcompat-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!