Share via

About the custom control renderer?

mc 7,186 Reputation points
2021-06-04T08:53:15.707+00:00

If I create a custom control I have to create its rendererer in xamarin.android and xamarin.ios.

but In xamarin.forms not xamarin.android and xamarin.ios can there be three files that

view.iOS.cs,view.android.cs,view.cs be the three renderer ?

which means view.iOS.cs will be in ios.

I do not need to write the code in each project?

Developer technologies | .NET | Xamarin
0 comments No comments

Answer accepted by question author

JarvanZhang 23,971 Reputation points
2021-06-07T05:45:24.287+00:00

Hello,​

Welcome to our Microsoft Q&A platform!

I do not need to write the code in each project?

Sorry, we cannot do that. Xamarin.Forms user interfaces are rendered using the native controls of the target platform. For some extended functions, we need achieve it on each platform using the native code. So it'll be necessary to create the .cs file in each project.

Best Regards,

Jarvan Zhang


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.