简体   繁体   中英

Write platform specific code in crossplatform xamarin project

I tried to use the Xamarin.Android namespace in my crossplatform Xamarin project. When i now build the .iOS Project, i get the notification, that this namespace is, obviously, not existing for iOS.

How can i write platform specific Code, where i use platform specific libraries ?

I already checked the Microsoft Docs but i did not find any information that could solve my problem.

PS: This is my first contribution to Stack Overflow, so feel free to ask for more detailed information.

Welcome to stack overflow.

https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/dependency-service/introduction

Above is a link to DependencyService documentation. DependencyService allows you as a developer to call platform-specific code from your Xamarin.Forms shared code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM