BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Xamarin.Forms Enables Truly Native Cross-platform UIs

Xamarin.Forms Enables Truly Native Cross-platform UIs

Leia em Português

This item in japanese

Bookmarks

Up until now one could write with Xamarin cross-platform native mobile applications that shared 80% of the code on average with the rest of 20% representing UI code that had to be written separately for each platform. The latest release, Xamarin 3.0, introduces Xamarin.Forms, a MVVM library for writing a single UI code in C# being executed natively on iOS, Android or Windows Phone.

With Xamarin.Forms a developer creates Pages –ContentPage, MasterDetailPage, NavigationPage, TabbedPage, CarouselPage - with controls chosen from a list of more than 40 widgets and layouts, including RelativeLayout, GridLayout, Button, TableView, ProgressBar, etc. When it comes to execution, each Page with its controls is rendered using the corresponding Page and controls of the operating system it runs upon. For example, rendering the Xamarin.Forms.DatePicker class on the three major mobile platforms looks like in the picture below, making an application looking fully native:

image

In case the library does not cover certain native functionality, the developer can mix/embed native pages written with Xamarin.iOS or Xamarin.Android with/in Xamarin.Forms pages. Also, one can defines custom pages, controls and layouts or customize Xamarin.Forms components by sub-classing them and overriding their behavior.

User interfaces created with Xamarin.Forms are saved in XAML and can be edited with a tool or by hand. The library includes support for a number of animations and maps. A number of samples are available on GitHub.

Rate this Article

Adoption
Style

BT