Create custom views.
Create platform-specific views built with Xamarin.iOS or Xamarin.Android to customize the user interface on each platform.
Use the Xamarin.Forms API to quickly build native apps for iOS, Android and Windows completely in C#. We built the above CRM app with Xamarin.Forms with over 96% code sharing across platforms. Xamarin.Forms is now available in both Xamarin Studio and Visual Studio.
If you know C#, you already know how to build iOS, Android, and Windows apps.
Author your UI in C# or XAML. Xamarin.Forms pages represent single screens within an app. Pages contain advanced gesture support and layouts, buttons, labels, lists, and other common controls. Connect these controls to shared backend code and you get fully native iOS, Android, and Windows Phone apps built entirely with shared C#.
using Xamarin.Forms; var profilePage = new ContentPage { Title = "Profile", Icon = "Profile.png", Content = new StackLayout { Spacing = 20, Padding = 50, VerticalOptions = LayoutOptions.Center, Children = { new Entry { Placeholder = "Username" }, new Entry { Placeholder = "Password", IsPassword = true }, new Button { Text = "Login", TextColor = Color.White, BackgroundColor = Color.FromHex("77D065") }}} }; var settingsPage = new ContentPage { Title = "Settings", Icon = "Settings.png", (...) }; var mainPage = new TabbedPage { Children = { profilePage, settingsPage } };<?xml version="1.0" encoding="UTF-8"?> <TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MyApp.MainPage"> <TabbedPage.Children> <ContentPage Title="Profile" Icon="Profile.png"> <StackLayout Spacing="20" Padding="20" VerticalOptions="Center"> <Entry Placeholder="Username" Text="{Binding Username}"/> <Entry Placeholder="Password" Text="{Binding Password}" IsPassword="true"/> <Button Text="Login" TextColor="White" BackgroundColor="#77D065" Command="{Binding LoginCommand}"/> </StackLayout> </ContentPage> <ContentPage Title="Settings" Icon="Settings.png"> <!-- Settings --> </ContentPage> </TabbedPage.Children> </TabbedPage>
At runtime, each page and its controls are mapped to platform-specific native user interface elements; for example, a Xamarin.Forms Entry becomes a UITextView on iOS, an EditText on Android, and a TextBox on Windows.
Create platform-specific views built with Xamarin.iOS or Xamarin.Android to customize the user interface on each platform.
Need device-level functionality? Use Xamarin.iOS and Xamarin.Android or use Xamarin.Forms services that abstract platform-specific APIs.
Use code or markup to build a beautiful UI with data-binding and styles, using either C# or XAML markup.
Increase your productivity by eliminating the need to run your app in order to see the layout with real-time previewing of Xamarin.Forms XAML source from directly within the IDE.
// MyApp.iOS/AppDelegate.cs
// Create a Xamarin.iOS UISegmentedControl
var mySegmentedControl = new UISegmentedControl();
mySegmentedControl.InsertSegment("One", 0, false);
mySegmentedControl.InsertSegment("Two", 1, false);
// Embed it right into Forms!
formsLayout.Children.Add(mySegmentedControl);
Design your own functionality or discover a visually striking pre-built component. Our partners have rewritten over 140 components so you can use the Xamarin.Forms API to easily build cross-platform apps entirely in C#.