Besides specifying the and horizontal spacing we pre-compute the width of the block with name, subject and body.To fill the available horizontal space completely, we need to refer to the screen width. In this chapter we will have a detailed look into each of these three projects. This is all it takes to define the UI of our first cross-platform app. This not only lets you play with the examples contained in the book, but gives you early access to new demos for future book editions. The new solution contains basically three projects: a shared project with all the cross-platform business logic and UI description as well as two projects with the platform specific integration and customization for Android and i OS devices. And the layout options just take care that it is nicely centered on the page.The visual appearance will be almost identical, but the implementation will be conceptually different.The The screenshot shows an overview of the final result.
In rare cases, however, you might want to compute positions or dimensions based on the current screen size.The number of rows or columns would then be automatically derived from the children added afterwards.Those child elements are identical to the ones added to the is probably the most powerful layout.The “inbox” contains four item blocks, each with icon, name, subject, body and time. Since it allows stacking elements in one direction only, we need to combine multiple stacks hierarchically to obtain the desired result.
Before looking into each of the four layouts, we define classes for the single visual elements. Like the main direction of one “email” block the with three equally sized rows is the default and can be neglected.
Therefore, we define the page padding (the space between grid and screen boundary), grid spacing (the space between neighboring grid cells) as well as row and column So far – and for the remaining chapters – we implemented layout descriptions using C# code.