Difference between AXML and XAML?

混江龙づ霸主 提交于 2019-12-21 06:58:25

问题


I'm new to Visual Studio Xamarin Cross-platform mobile development and I keep on searching about AXML I just can't find any tutorial for designing and applying an MVC approach.

I have a lot of questions regarding this actually. But i'll just leave this 3 here first.

  1. What is their difference?
  2. Can xaml designs be applied in axml?
  3. How do I apply my css to axml files?

回答1:


1 - What is their difference?

AXML: Describe the UI for only Android apps. These are the same files used by Android native applications.

XAML: Specifies Xamarin.Forms layouts; these files describe a cross platform layout that each platform then renders in their native controls

2 - Can xaml designs be applied in axml?

Xaml designs cannot be directly copied into AXML (as they specify different controls) but they can be ported to AXML. Conceptually, xaml files describe how a UI should look on both platforms.

3 - How do I apply my css to axml files?

Cascading style sheets (CSS) are not applicable to Xaml as they describe how to style HTML. To style Xaml, look at the styles API used by Xamarin.Forms




回答2:


What is their difference?

  • AXML and XAML are two different XML specifications.
  • AXML is just supported/available for Xamarin.Android.
  • XAML is the way Xamarin Forms could standardize Cross Platform UI based on XML specification.
  • If you are using native Xamarin Android you will do UI using axml, if using Forms then using XAML.

Reference from What is the difference between Xaml & axml in Xamarin Technology

Can xaml designs be applied in axml?

No, since there is no direct translation between what Android can do and what Xamarin.Forms can.

How do I apply my css to axml files?

You need to make your UI looks like CSS there is no direct way I know which can include your CSS to a AXML file.



来源:https://stackoverflow.com/questions/40500120/difference-between-axml-and-xaml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!