2

I'm working on a Xamarin.Forms apps, and am finished with the Windows Phone part. However I'm having issues with the Android part of it.

I use a custom element to display the home page - it is a slidable two-tab view. On Windows Phone I've solved this using a relatively simple User Control, consisting of a Pivot, with two pre-defined pages.

How could I do the same on Android, using both AXML for the layout and defining the code in a separate class?

fonix232
  • 2,132
  • 6
  • 39
  • 69

1 Answers1

0

You could leverage this example from Xamarin for your Swiping TabLayout: https://developer.xamarin.com/samples/monodroid/ActionBarViewPager/

Then you could use that as a custom control in Xamarin.Forms by creating a custom renderer for it. This tutorial is for iOS, but it essentially does what you need to do. Reuses an existing iOS UIViewController as a custom Page in Xamarin Forms: http://blog.xamarin.com/using-custom-uiviewcontrollers-in-xamarin.forms-on-ios/

pnavk
  • 4,552
  • 2
  • 19
  • 43