Leogreen
Leogreen

Reputation: 701

XAML & AXML Xamarin

i'm totaly newbie with xamarin. Iknow whats is XAML file, and AXML . But i don't understood on this project ( New/ Cross plat. / Android )

The files XAML or AXML.

I have : APP.XAML and MainPage.XAML but also in layout Tabbar.axml and toolbar.axml

Running the app, the main page displays the label

<?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:App1"
         x:Class="App1.MainPage">
**<Label Text="APP TEST HUB" **
 VerticalOptions="Center" 
  HorizontalOptions="Center" />

enter image description here

But i can't acess the toolbox to designer. Openning the layout Tabbar.axml and toolbar.axml files i can acess the toolbox and work in design, but running the app this files isn't appears.

Can anyone tell me the difference of the files and his importance to the project . Where i'll work my design ?

Upvotes: 1

Views: 1373

Answers (3)

Supun Liyanaarachchi
Supun Liyanaarachchi

Reputation: 549

why xamrin layout use axml file but xamarin form user xaml?

AXML and XAML are two different XML specs.

AXML is used to define native ui in Xamarin.Android based on XML spec:

xml.com/axml/axml.html

AXML Is just supported/available for Xamarin.Android.

XAML is the way Xamarin Forms could standardize Cross Platform UI based on XML spec

https://msdn.microsoft.com/en-us/library/cc295302.aspx

If you are using native Xamarin Android you will do UI using axml if using Forms then using XAML.

Upvotes: 0

jbtamares
jbtamares

Reputation: 778

In addition to Jason's answer, XAML uses the basic native UI of what to be shown to each platform, if you wanted to have an extensive/heavy UI, you have to use a CustomRenderer in order for it to be applied in your XAML code.

Upvotes: 0

Jason
Jason

Reputation: 89102

XAML files are used by Xamarin Forms projects. AXML files are used by Xamarin Android (and native Android) projects.

You appear to have created a Xamarin Forms project. Typically you would do this if you wanted to create an app that ran on multiple platforms (iOS, Android, etc). In Xamarin Forms projects, the platform project (Android in your case) is primarily used to bootstrap the Forms code that lives in the shared project. Most of the UI actually is defined in the shared project via XAML files.

Upvotes: 5

Related Questions