Xamarin.Forms Enables Truly Native Cross-platform UIs

| by Abel Avram Follow 12 Followers on May 29, 2014. Estimated reading time: 1 minute |

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:


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 Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

not cross-platform by Steven Shaw

This tech sounds great but is only available on mobile platforms by the look of it. If there was support for a JS/HTML5 target platform - particularly one supporting mobile web and desktop web, then I'd be happy to dub it cross-platform!

Re: not cross-platform by Abel Avram

I'm not getting into a war over definitions. In my opinion a tool/framework/language is cross-platform if it addresses at least 2-3 platforms. Xamarin does that by creating binaries that are deployed on iOS, Android or Windows Phone via their respective app stores.

Re: not cross-platform by Rosani Masau

This tech is not only available in mobile platforms. It supports Windows 8 which is a desktop platform. Futhermore it supports multiple platforms such as Windows 8, Windows Phone 8, iOS, Android, FireOS. Just because it does not support JS/HTML5 doesn't mean its not-cross platform. And by the way Xamarin made the decision to compile directly to native and not use an interpreter such as JS/HTML5 due to performance issues and security issues with JS/HTML5

Re: not cross-platform by Steven Shaw

No war necessary. Let's just say that it's not cross-platform to me :).

Haxe I consider to be cross-platform but has other issues.

Re: not cross-platform by Steven Shaw

Thanks for the info about desktop support for Window 8. That's great but not what I need.

Thing is, I am happy that the mobile support is "native" and not JS/HTML5/CSS3 but that does not mean that you can't _also_ support JS/HTML5/CSS3 for the widest possible reach :).

Re: not cross-platform by Nick Turner

You don't understand cross platform. platform refers to devices not a desk top. Js/Html is not a platform. And yes Xamarin supports web mobile. If you want a web site you use a web server, not a phone.

By the way, the JS HTML 5 is supported via web views, but I doubt you know what JS actually is, other than some error that pops up in internet explorer when your using your timesheet.

Re: not cross-platform by Steven Shaw

Re: not cross-platform by Jordan Bortz

There are still a lot of reasons to have a native apps...hence this product and many others like it

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

8 Discuss