Forum Xamarin.Forms

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

How can I make a class library that contains both Android and iOS platform specific code?

MichalDiviMichalDivi USMember ✭✭

Hey there,

I want to create a class library that would contain my custom Xamarin.Forms camera view and it's implementations (renderers and helper classes for the renderers) for both Android and iOS platforms.

However, I've got no idea what project could contain all of the mentioned things. Android code needs it to be the Mono.Android class library, the iOS project probably needs something different (haven't checked that).

Is there a way to do this?

Thanks

Answers

  • YelinzhYelinzh Member, Xamarin Team Xamurai
    edited June 2020

    I want to create a class library that would contain my custom Xamarin.Forms camera view and it's implementations ... for both Android and iOS platforms.

    A Xamarin plugin is basically a common use case (feature) that we used to implement natively on our projects. For this feature, try to create a custom plugin about the function you want. The function method will be able to used directly in a Xamarin.Forms project with the plugin.

    How to create a Xamarin plugin, you could google the keyword as Let’s Create A Xamarin Plugin to check the related guideline.

Sign In or Register to comment.