Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code for embedding native controls in Xamarin.Forms
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:EmbedNativeAwesomeness"
xmlns:ios="clr-namespace:UIKit;assembly=Xamarin.iOS;targetPlatform=iOS"
xmlns:ioscustom="clr-namespace:EmbedNativeAwesomeness.iOS;assembly=EmbedNativeAwesomeness.iOS;targetPlatform=iOS"
xmlns:android="clr-namespace:Android.Widget;assembly=Mono.Android;targetPlatform=Android"
xmlns:androidForms="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.Platform.Android;targetPlatform=Android"
x:Class="EmbedNativeAwesomeness.EmbedNativeAwesomenessPage">
<StackLayout VerticalOptions="Center" HorizontalOptions="Center">
<Label Text="Isn't this awesome?!" VerticalOptions="Center" HorizontalOptions="Center" />
<ios:UIDatePicker />
<ios:UISlider <strong>MaxValue="10" Value="{Binding SlideValue}"</strong> />
<ios:UIStepper />
<ios:UISwitch />
<ioscustom:UiRedTintSwitch />
<android:RatingBar x:Arguments="{x:Static androidForms:Forms.Context}" />
</StackLayout>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment