Xamarin
Xamarin Forms
Introduction
Xamarin.Formsis a framework for creating cross-platform native mobile apps with C# and XAML, by using Visual Studio.Xamarin.Forms isn't rendered in a webview. Instead, internally it uses the Android SDK or the iOS SDK to create native controls for native performance.
Xamarin.Essentialshandles many of the common needs of mobile apps that don't have to do with the UI. That means withXamarin.EssentialsNuGet package, you can access things like the GPS, the accelerometer, and battery and network states etc.
Pages
Pages are the root of the UI hierarchy in
Xamarin.Forms.On iOS, the Page is mapped to
ViewController, on Android, it is mapped to somewhat likeActivityand on Universal Windows Platform, it is mapped toPage.Types
ContentPage: A content page simply displays its contents.MasterDetailPage: This hosts drawer type navigation as well as split views. It has two key properties,MasterandDetail, each of which is assigned aContentPage.NavigationPage: This adds the familiar navigation bar to the top of the screen, but more importantly manages a navigation stack. This stack allows the user to navigate backward to previous screens.TabbedPage: This is the root page used for tab navigation.
Layouts

StackLayout- Lays out controls in a top-to-bottom or left-to-right stack depending on an orientation property.AbsoluteLayout- Lets us set exact coordinates for controls.RelativeLayout- Lets us define relationships between multiple controls' sizes and shapes. For instance,button1should be 50% the size ofentry1and should be 5 points below it.Grid- Lays out its controls according to a column and row location we set. We can define the column and row sizes as well as spans, so grid layouts don't necessarily have a "checkerboard look" to them.ScrollView- Technically, this isn't considered a layout, since it only holds one child directly but it's very important to screen layouts. By default, all the other layouts will actually try to squeeze their contents, if necessary, to fit on a single screen. But if those other layouts are put inside a ScrollView, then the screen can scroll and squeezing the contents isn't necessary.
Last updated
Was this helpful?