-
Xamarin - Anatomy of an app
The modern user interface is constructed from visual objects of various sorts. Depending on the operating system, these visual objects might go by different names—controls, elements, views, widgets—but they are all devoted to the jobs of presentation or interaction or both.
In Xamarin.Forms, the objects that appear on the screen are collectively called visual elements. They come in three main categories:
page
layout
view
These are not abstract concepts! The Xamarin.Forms application programming interface (API) defines classes named VisualElement, Page, Layout, and View. These classes and their descendants form the backbone of the Xamarin.Forms user interface. VisualElement is an exceptionally important class in Xamarin.Forms. A VisualElement object is anything that occupies space on the screen.
A Xamarin.Forms application consists of one or more pages. A page usually occupies all (or at least a large area) of the screen. Some applications consist of only a single page, while others allow navigating between multiple pages.
On each page, the visual elements are organized in a parent-child hierarchy. The child of a ContentPage is generally a layout of some sort to organize the visuals. Some layouts have a single child, but many layouts have multiple children that the layout arranges within itself. These children can be other layouts or views. Different types of layouts arrange children in a stack, in a two-dimensional grid, or in a more freeform manner. In this chapter, however, our pages will contain just a single child.
The term view in Xamarin.Forms denotes familiar types of presentation and interactive objects: text, bitmaps, buttons, text-entry fields, sliders, switches, progress bars, date and time pickers, and others of your own devising. These are often called controls or widgets in other programming environments. This book refers to them as views or elements. In this chapter, you’ll encounter the Label view for displaying text.
Source of Information : Creating Mobile Apps with Xamarin.Forms
Subscribe to:
Post Comments (Atom)
0 comments: