Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I design the UI in Xamarin.Forms by using XAML

I'm trying to create a cross platform app using Xamarin.Forms. As far as I know, the UI will be created from the code and the .axml file will be generated automatically.

Can I modify the .axml file to edit the UI? I tried editing but all that comes up is what is written in the code. ie: hello forms

UPDATE

public static Page GetMainPage ()
        {   
            return new simplerow ();
        }
like image 866
techno Avatar asked Oct 08 '14 09:10

techno


1 Answers

In Xamarin.Forms you can create your pages from markup definitions that are shared across all platforms.

Typically you will write all your content pages using Xamarin.Forms, however you can mix-and-match native pages into an application should you so wish.

These shared common pages, written in Xamarin.Forms, will reside maybe in a PCL project, or a Shared Project so these can then be re-used in the platform-specific projects, each targeting a specific platform OS.

You can write these common pages, either in code, or in XAML. You can even choose to write some pages one way, and some the other if you so choose.

A Xamarin.Forms page is processed at runtime through the interpretation of the page composition that has been created.

Each control that is specified on a page, has its own platform specific renderer, behind the scenes, that will produce output that is targetted to that OS.

When writing Xamarin.Forms pages, for-the-most, you will start to learn a new way of creating pages that is abstracted from the intricacies of creating mobile applications on each different platform OS.

There is therefore no editable .axml that is generated etc as you will write your pages using Xamarin.Forms markup and controls, and even your own or other custom-controls to produce your own application pages.

The following link shows some examples of how to write XAML pages.

The following link shows some examples of how to write from code-behind pages.

like image 84
Pete Avatar answered Sep 30 '22 02:09

Pete