Xamarin how it is getting the Native Look and Feel?

前端 未结 1 690
忘了有多久
忘了有多久 2021-02-06 00:07

I am new to Xamarin. I have few confusion here.

Question:

  1. How does Xamarin get the Native Look and Feel of the UI Components?.
  2. D
相关标签:
1条回答
  • 2021-02-06 00:40

    I think you are way off.

    Xamarin provides C# and the .Net (Mono) runtime on iOS and Android. At the same time they expose the native APIs on each platform to C#. So they built a way for C# to call into Objective-C and Java (and vice versa).

    This means you develop native UIs on each platform, and can share backend business logic between platforms. A Xamarin app can share somewhere between 50-75% of its code across platforms. There is no general sharing of the UI across platforms, since this would abstract away the native APIs.

    To break it down:

    Android

    • Use Xamarin Studio or Visual Studio to develop your C# backend code
    • Use Xamarin's Android designer to layout native Android XML layouts

    iOS

    • Use Xamarin Studio or Visual Studio* to develop your C# backend code
    • Use XCode on a Mac to layout storyboard or XIB files for native iOS UI layout

    Both options you can create your UI from code as well, but the native APIs will be different on each platform.

    *A mac is needed to compile for iOS

    0 讨论(0)
提交回复
热议问题