Showing native pages with renderers

While having all this cross-platform user interface behavior and code sharing, sometimes you still need to completely customize a page and blend it with native pages.

In this recipe, we will create an example of loading native platform views for iOS XIB, Android AXML, and Windows Phone UserControl interfaces.

How to do it…

  1. Create your cross-platform Xamarin.Forms application using a PCL to share code in Visual Studio or Xamarin Studio; let's name it XamFormsNativePages. We used Visual Studio in this example, as it's so easy to have all three projects ready for development!
  2. Create a page to use it as our host MainPage. Right-click in the core PCL library and Add | Class…, and name it MainPage.
  3. Use the following code. ...

Get Xamarin: Cross-Platform Mobile Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.